home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / xvga_r2 / source / xvga.pas
Encoding:
Pascal/Delphi Source File  |  1995-03-20  |  428.6 KB  |  14,149 lines

  1. nstrate the GetImage and PutImage commands }
  2.  
  3. const
  4.   r  = 20;
  5.   StartX = 100;
  6.   StartY = 50;
  7.  
  8. var
  9.   CurPort : ViewPortType;
  10.  
  11. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  12. var
  13.   Step : integer;
  14. begin
  15.   Step := Random(2*r);
  16.   if Odd(Step) then
  17.     Step := -Step;
  18.   X := X + Step;
  19.   Step := Random(r);
  20.   if Odd(Step) then
  21.     Step := -Step;
  22.   Y := Y + Step;
  23.  
  24.   { Make saucer bounce off viewport walls }
  25.   with CurPort do
  26.   begin
  27.     if (x1 + X + Width - 1 > x2) then
  28.       X := x2-x1 - Width + 1
  29.     else
  30.       if (X < 0) then
  31.         X := 0;
  32.     if (y1 + Y + Height - 1 > y2) then
  33.       Y := y2-y1 - Height + 1
  34.     else
  35.       if (Y < 0) then
  36.         Y := 0;
  37.   end;
  38. end; { MoveSaucer }
  39.  
  40. var
  41.   Pausetime : word;
  42.   Saucer    : pointer;
  43.   X, Y      : integer;
  44.   ulx, uly  : word;
  45.   lrx, lry  : word;
  46.   Size      : word;
  47.   I         : word;
  48. begin
  49.   ClearDevice;
  50.   FullPort;
  51.  
  52.   { PaintScreen }
  53.   ClearDevice;
  54.   MainWindow('GetImage / PutImage Demonstration');
  55.   StatusLine('Esc aborts or press a key...');
  56.   GetViewSettings(CurPort);
  57.  
  58.   { DrawSaucer }
  59.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  60.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  61.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  62.   Circle(StartX+10, StartY-12, 2);
  63.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  64.   Circle(StartX-10, StartY-12, 2);
  65.   SetFillStyle(SolidFill, MaxColor);
  66.   FloodFill(StartX+1, StartY+4, GetColor);
  67.  
  68.   { ReadSaucerImage }
  69.   ulx := StartX-(r+1);
  70.   uly := StartY-14;
  71.   lrx := StartX+(r+1);
  72.   lry := StartY+(r div 3)+3;
  73.  
  74.   Size := ImageSize(ulx, uly, lrx, lry);
  75.   GetMem(Saucer, Size);
  76.   GetImage(ulx, uly, lrx, lry, Saucer^);
  77. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  78.  
  79.   { Plot some "stars" }
  80.   for I := 1 to 1000 do
  81.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  82.   X := MaxX div 2;
  83.   Y := MaxY div 2;
  84.   PauseTime := 70;
  85.  
  86.   { Move the saucer around }
  87.   repeat
  88. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  89.      Delay(PauseTime);
  90. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  91.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  92.   until KeyPressed;
  93.   FreeMem(Saucer, size);
  94.   WaitToGo;
  95. end; { PutImagePlay }
  96.  
  97. procedure PolyPlay;
  98. { Draw random polygons with random fill styles on the screen }
  99. const
  100.   MaxPts = 5;
  101. type
  102.   PolygonType = array[1..MaxPts] of PointType;
  103. var
  104.   Poly : PolygonType;
  105.   I, Color : word;
  106. begin
  107.   MainWindow('FillPoly demonstration');
  108.   StatusLine('Esc aborts or press a key...');
  109.   repeat
  110.     Color := RandColor;
  111.     SetFillStyle(Random(11)+1, Color);
  112.     SetColor(Color);
  113.     for I := 1 to MaxPts do
  114.       with Poly[I] do
  115.       begin
  116.         X := Random(MaxX);
  117.         Y := Random(MaxY);
  118.       end;
  119.     FillPoly(MaxPts, Poly);
  120.   until KeyPressed;
  121.   WaitToGo;
  122. end; { PolyPlay }
  123.  
  124. procedure FillStylePlay;
  125. { Display all of the predefined fill styles available }
  126. var
  127.   Style    : word;
  128.   Width    : word;
  129.   Height   : word;
  130.   X, Y     : word;
  131.   I, J     : word;
  132.   ViewInfo : ViewPortType;
  133.  
  134. procedure DrawBox(X, Y : word);
  135. begin
  136.   SetFillStyle(Style, MaxColor);
  137.   with ViewInfo do
  138.     Bar(X, Y, X+Width, Y+Height);
  139.   Rectangle(X, Y, X+Width, Y+Height);
  140.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  141.   Inc(Style);
  142. end; { DrawBox }
  143.  
  144. begin
  145.   MainWindow('Pre-defined fill styles');
  146.   GetViewSettings(ViewInfo);
  147.   with ViewInfo do
  148.   begin
  149.     Width := 2 * ((x2+1) div 13);
  150.     Height := 2 * ((y2-10) div 10);
  151.   end;
  152.   X := Width div 2;
  153.   Y := Height div 2;
  154.   Style := 0;
  155.   for J := 1 to 3 do
  156.   begin
  157.     for I := 1 to 4 do
  158.     begin
  159.       DrawBox(X, Y);
  160.       Inc(X, (Width div 2) * 3);
  161.     end;
  162.     X := Width div 2;
  163.     Inc(Y, (Height div 2) * 3);
  164.   end;
  165.   SetTextJustify(LeftText, TopText);
  166.   WaitToGo;
  167. end; { FillStylePlay }
  168.  
  169. procedure FillPatternPlay;
  170. { Display some user defined fill patterns }
  171. const
  172.   Patterns : array[0..11] of FillPatternType = (
  173.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  174.             OldColor which has a path of pixels of OldColor or NewColor
  175.             with sides touching back to the seed point, (XSeed, YSeed).
  176.             Therefore, only pixels of OldColor are modified and no other
  177.             information is changed.
  178.  
  179.             SEE ALSO
  180.  
  181.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  182.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  183.             SETVIEW
  184.  
  185.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  186.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  187.             IF WHICHVGA = 0 THEN STOP
  188.             DUMMY=RES640
  189.             SETVIEW 100, 100, 539, 379
  190.             FILLVIEW 10
  191.             WHILE INKEY$ = ""
  192.             WEND
  193.             VIDEOMODESET VMODE
  194.             END
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.                                                                          63
  212.  
  213.  
  214.  
  215.  
  216.  
  217.           FONTGETINFO
  218.  
  219.             PROTOTYPE
  220.  
  221.             SUB FONTGETINFO (Width%, Height%)
  222.  
  223.             INPUT
  224.  
  225.             no input parameters
  226.     WEND
  227.             MOUSEEXIT
  228.             VIDEOMODESET VMODE
  229.             END
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.                                                                          86
  271.  
  272.  
  273.  
  274.  
  275.  
  276.           MOUSECURSORDEFAULT
  277.  
  278.             PROTOTYPE
  279.  
  280.             SUB MOUSECURSORDEFAULT ()
  281.  
  282.             INPUT
  283.  
  284.             no input parameters
  285.  
  286.             OUTPUT
  287.  
  288.             no value returned
  289.  
  290.             USAGE
  291.  
  292.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  293.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  294. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  295. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  296. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  297. $╤
  298. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  299. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  300. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  301.       end;
  302.     end;
  303.   end;
  304.   WaitToGo;
  305. end; { UserLineStylePlay }
  306.  
  307.  
  308. procedure SayGoodbye;
  309. { Say goodbye and then exit the program }
  310. var
  311.   ViewInfo : ViewPortType;
  312. begin
  313.   MainWindow('');
  314.   GetViewSettings(ViewInfo);
  315.   SetTextStyle(TriplexFont, HorizDir, 4);
  316.   SetTextJustify(CenterText, CenterText);
  317.   with ViewInfo do
  318.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  319.   StatusLine('Press any key to quit...');
  320.   repeat until KeyPressed;
  321. end; { SayGoodbye }
  322.  
  323.  
  324. PROCEDURE SelectMode;
  325. VAR
  326.     choice1,choice2     : CHAR;
  327.    xsize,ysize            : WORD;
  328. BEGIN
  329.     (* Let's select a mode *)
  330.     ClrScr;
  331.     WriteLn('VESADEMO:');
  332.     WriteLn('1. 256 colors');
  333.     WriteLn('2. 32768 colors');
  334.     WriteLn('3. 65536 colors');
  335.     WriteLn('4. 16777216 colors');
  336.     WriteLn('Q uit');
  337.     WriteLn;
  338.     Write('Your choice: ');
  339.     REPEAT
  340.         ReadLn(choice1);
  341.       IF choice1 <> '1' THEN BEGIN
  342.           WriteLn('Sorry !');
  343.          WriteLn('This demo wasn''t written for more as 256 colors !');
  344.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  345.          WriteLn('Switching to 256 colors.');
  346.          choice1 := '1';
  347.       END;
  348.     UNTIL choice1 IN ['1'..'4','q'];
  349.     IF choice1 = 'q' THEN Halt;
  350.  
  351.     WriteLn;
  352.     WriteLn;
  353.     WriteLn('a. 320x200');
  354.     WriteLn('b. 640x480');
  355.     WriteLn('c. 800x600');
  356.     WriteLn('d. 1024x768');
  357.     WriteLn('e. 1280x1024');
  358.     WriteLn('Q uit');
  359.     WriteLn;
  360.     Write('Your choice: ');
  361.     REPEAT
  362.         ReadLn(choice2);
  363.     UNTIL choice2 IN ['a'..'e','q'];
  364.     IF choice2 = 'q' THEN Halt;
  365.  
  366.     CASE choice2 OF
  367.         'a' : BEGIN
  368.             xsize := 320;
  369.             ysize := 200;
  370.         END;
  371.         'b' : BEGIN
  372.             xsize := 640;
  373.             ysize := 480;
  374.         END;
  375.         'c' : BEGIN
  376.             xsize := 800;
  377.             ysize := 600;
  378.         END;
  379.         'd' : BEGIN
  380.             xsize := 1024;
  381.             ysize := 768;
  382.         END;
  383.         'e' : BEGIN
  384.             xsize := 1280;
  385.             ysize := 1024;
  386.         END;
  387.     END;
  388.     CASE choice1 OF
  389.         '1' : mode := FindVesaMode(xsize,ysize,8);
  390.         '2' : mode := FindVesaMode(xsize,ysize,15);
  391.         '3' : mode := FindVesaMode(xsize,ysize,16);
  392.         '4' : mode := FindVesaMode(xsize,ysize,24);
  393.     END;
  394.     IF mode = 0 THEN BEGIN
  395.         WriteLn('No such mode could be found !');
  396.         WriteLn('Switching to to 320x200.');
  397.         ReadKey;
  398.         mode := V320x200x256;
  399.     END;
  400. END;
  401.  
  402. begin { program body }
  403.   SelectMode;
  404.   Initialize;
  405.   ReportStatus;
  406.  
  407. {  AspectRatioPlay; }
  408.   FillEllipsePlay;
  409.   SectorPlay;
  410.   WriteModePlay;
  411.  
  412.   ColorPlay;
  413.   { PalettePlay only intended to work on these drivers: }
  414.   if (GraphDriver = EGA) or
  415.       (GraphDriver = EGA64) or
  416.       (GraphDriver = VGA) then
  417.      PalettePlay;
  418.   PutPixelPlay;
  419. {  PutImagePlay; }
  420.   RandBarPlay;
  421.   BarPlay;
  422.   Bar3DPlay;
  423.   ArcPlay;
  424.   CirclePlay;
  425.   PiePlay;
  426.   LineToPlay;
  427.   LineRelPlay;
  428. {  LineStylePlay; }
  429. {  UserLineStylePlay; }
  430.   TextDump;
  431.   TextPlay;
  432.   CrtModePlay;
  433.   FillStylePlay;
  434.   FillPatternPlay;
  435.   PolyPlay;
  436.   SayGoodbye;
  437. {  CloseGraph; }
  438.   CloseVesa;
  439. end.
  440. ***************************************************
  441.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  442.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  443. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  444. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  445.     Color := RandColor;
  446.     SetColor(Color);
  447.     SetFillStyle(Random(CloseDotFill)+1, Color);
  448.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  449.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  450.   until KeyPressed;
  451.   WaitToGo;
  452. end; { RandBarPlay }
  453.  
  454. procedure ArcPlay;
  455. { Draw random arcs on the screen }
  456. var
  457.   MaxRadius : word;
  458.   EndAngle : word;
  459.   ArcInfo : ArcCoordsType;
  460. begin
  461.   MainWindow('Arc / GetArcCoords demonstration');
  462.   StatusLine('Esc aborts or press a key');
  463.   MaxRadius := MaxY div 10;
  464.   repeat
  465.     SetColor(RandColor);
  466.     EndAngle := Random(360);
  467.     SetLineStyle(SolidLn, 0, NormWidth);
  468.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  469.     GetArcCoords(ArcInfo);
  470.     with ArcInfo do
  471.     begin
  472.       Line(X, Y, XStart, YStart);
  473.       Line(X, Y, Xend, Yend);
  474.     end;
  475.   until KeyPressed;
  476.   WaitToGo;
  477. end; { ArcPlay }
  478.  
  479. procedure PutPixelPlay;
  480. { Demonstrate the PutPixel and GetPixel commands }
  481. const
  482.   Seed   = 1962; { A seed for the random number generator }
  483.   NumPts = 2000; { The number of pixels plotted }
  484.   Esc    = #27;
  485. var
  486.   I : word;
  487.   X, Y, Color : word;
  488.   XMax, YMax  : integer;
  489.   ViewInfo    : ViewPortType;
  490. begin
  491.   MainWindow('PutPixel / GetPixel demonstration');
  492.   StatusLine('Esc aborts or press a key...');
  493.  
  494.   GetViewSettings(ViewInfo);
  495.   with ViewInfo do
  496.   begin
  497.     XMax := (x2-x1-1);
  498.     YMax := (y2-y1-1);
  499.   end;
  500.  
  501.   while not KeyPressed do
  502.   begin
  503.     { Plot random pixels }
  504.     RandSeed := Seed;
  505.     I := 0;
  506.     while (not KeyPressed) and (I < NumPts) do
  507.     begin
  508.       Inc(I);
  509.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  510.     end;
  511.  
  512.     { Erase pixels }
  513.     RandSeed := Seed;
  514.     I := 0;
  515.     while (not KeyPressed) and (I < NumPts) do
  516.     begin
  517.       Inc(I);
  518.       X := Random(XMax)+1;
  519.       Y := Random(YMax)+1;
  520.       Color := GetPixel(X, Y);
  521.         if Color = RandColor then
  522.           PutPixel(X, Y, 0);
  523.      end;
  524.   end;
  525.   WaitToGo;
  526. end; { PutPixelPlay }
  527.  
  528. procedure PutImagePlay;
  529. { Demonstrate the GetImage and PutImage commands }
  530.  
  531. const
  532.   r  = 20;
  533.   StartX = 100;
  534.   StartY = 50;
  535.  
  536. var
  537.   CurPort : ViewPortType;
  538.  
  539. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  540. var
  541.   Step : integer;
  542. begin
  543.   Step := Random(2*r);
  544.   if Odd(Step) then
  545.     Step := -Step;
  546.   X := X + Step;
  547.   Step := Random(r);
  548.   if Odd(Step) then
  549.     Step := -Step;
  550.   Y := Y + Step;
  551.  
  552.   { Make saucer bounce off viewport walls }
  553.   with CurPort do
  554.   begin
  555.     if (x1 + X + Width - 1 > x2) then
  556.       X := x2-x1 - Width + 1
  557.     else
  558.       if (X < 0) then
  559.         X := 0;
  560.     if (y1 + Y + Height - 1 > y2) then
  561.       Y := y2-y1 - Height + 1
  562.     else
  563.       if (Y < 0) then
  564.         Y := 0;
  565.   end;
  566. end; { MoveSaucer }
  567.  
  568. var
  569.   Pausetime : word;
  570.   Saucer    : pointer;
  571.   X, Y      : integer;
  572.   ulx, uly  : word;
  573.   lrx, lry  : word;
  574.   Size      : word;
  575.   I         : word;
  576. begin
  577.   ClearDevice;
  578.   FullPort;
  579.  
  580.   { PaintScreen }
  581.   ClearDevice;
  582.   MainWindow('GetImage / PutImage Demonstration');
  583.   StatusLine('Esc aborts or press a key...');
  584.   GetViewSettings(CurPort);
  585.  
  586.   { DrawSaucer }
  587.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  588.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  589.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  590.   Circle(StartX+10, StartY-12, 2);
  591.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  592.   Circle(StartX-10, StartY-12, 2);
  593.   SetFillStyle(SolidFill, MaxColor);
  594.   FloodFill(StartX+1, StartY+4, GetColor);
  595.  
  596.   { ReadSaucerImage }
  597.   ulx := StartX-(r+1);
  598.   uly := StartY-14;
  599.   lrx := StartX+(r+1);
  600.   lry := StartY+(r div 3)+3;
  601.  
  602.   Size := ImageSize(ulx, uly, lrx, lry);
  603.   GetMem(Saucer, Size);
  604.   GetImage(ulx, uly, lrx, lry, Saucer^);
  605. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  606.  
  607.   { Plot some "stars" }
  608.   for I := 1 to 1000 do
  609.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  610.   X := MaxX div 2;
  611.   Y := MaxY div 2;
  612.   PauseTime := 70;
  613.  
  614.   { Move the saucer around }
  615.   repeat
  616. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  617.      Delay(PauseTime);
  618. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  619.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  620.   until KeyPressed;
  621.   FreeMem(Saucer, size);
  622.   WaitToGo;
  623. end; { PutImagePlay }
  624.  
  625. procedure PolyPlay;
  626. { Draw random polygons with random fill styles on the screen }
  627. const
  628.   MaxPts = 5;
  629. type
  630.   PolygonType = array[1..MaxPts] of PointType;
  631. var
  632.   Poly : PolygonType;
  633.   I, Color : word;
  634. begin
  635.   MainWindow('FillPoly demonstration');
  636.   StatusLine('Esc aborts or press a key...');
  637.   repeat
  638.     Color := RandColor;
  639.     SetFillStyle(Random(11)+1, Color);
  640.     SetColor(Color);
  641.     for I := 1 to MaxPts do
  642.       with Poly[I] do
  643.       begin
  644.         X := Random(MaxX);
  645.         Y := Random(MaxY);
  646.       end;
  647.     FillPoly(MaxPts, Poly);
  648.   until KeyPressed;
  649.   WaitToGo;
  650. end; { PolyPlay }
  651.  
  652. procedure FillStylePlay;
  653. { Display all of the predefined fill styles available }
  654. var
  655.   Style    : word;
  656.   Width    : word;
  657.   Height   : word;
  658.   X, Y     : word;
  659.   I, J     : word;
  660.   ViewInfo : ViewPortType;
  661.  
  662. procedure DrawBox(X, Y : word);
  663. begin
  664.   SetFillStyle(Style, MaxColor);
  665.   with ViewInfo do
  666.     Bar(X, Y, X+Width, Y+Height);
  667.   Rectangle(X, Y, X+Width, Y+Height);
  668.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  669.   Inc(Style);
  670. end; { DrawBox }
  671.  
  672. begin
  673.   MainWindow('Pre-defined fill styles');
  674.   GetViewSettings(ViewInfo);
  675.   with ViewInfo do
  676.   begin
  677.     Width := 2 * ((x2+1) div 13);
  678.     Height := 2 * ((y2-10) div 10);
  679.   end;
  680.   X := Width div 2;
  681.   Y := Height div 2;
  682.   Style := 0;
  683.   for J := 1 to 3 do
  684.   begin
  685.     for I := 1 to 4 do
  686.     begin
  687.       DrawBox(X, Y);
  688.       Inc(X, (Width div 2) * 3);
  689.     end;
  690.     X := Width div 2;
  691.     Inc(Y, (Height div 2) * 3);
  692.   end;
  693.   SetTextJustify(LeftText, TopText);
  694.   WaitToGo;
  695. end; { FillStylePlay }
  696.  
  697. procedure FillPatternPlay;
  698. { Display some user defined fill patterns }
  699. const
  700.   Patterns : array[0..11] of FillPatternType = (
  701.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  702.             OldColor which has a path of pixels of OldColor or NewColor
  703.             with sides touching back to the seed point, (XSeed, YSeed).
  704.             Therefore, only pixels of OldColor are modified and no other
  705.             information is changed.
  706.  
  707.             SEE ALSO
  708.  
  709.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  710.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  711.             SETVIEW
  712.  
  713.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  714.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  715.             IF WHICHVGA = 0 THEN STOP
  716.             DUMMY=RES640
  717.             SETVIEW 100, 100, 539, 379
  718.             FILLVIEW 10
  719.             WHILE INKEY$ = ""
  720.             WEND
  721.             VIDEOMODESET VMODE
  722.             END
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.  
  738.  
  739.                                                                          63
  740.  
  741.  
  742.  
  743.  
  744.  
  745.           FONTGETINFO
  746.  
  747.             PROTOTYPE
  748.  
  749.             SUB FONTGETINFO (Width%, Height%)
  750.  
  751.             INPUT
  752.  
  753.             no input parameters
  754.     WEND
  755.             MOUSEEXIT
  756.             VIDEOMODESET VMODE
  757.             END
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.                                                                          86
  799.  
  800.  
  801.  
  802.  
  803.  
  804.           MOUSECURSORDEFAULT
  805.  
  806.             PROTOTYPE
  807.  
  808.             SUB MOUSECURSORDEFAULT ()
  809.  
  810.             INPUT
  811.  
  812.             no input parameters
  813.  
  814.             OUTPUT
  815.  
  816.             no value returned
  817.  
  818.             USAGE
  819.  
  820.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  821.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  822. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  823. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  824. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  825. $╤
  826. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  827. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  828. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  829.       end;
  830.     end;
  831.   end;
  832.   WaitToGo;
  833. end; { UserLineStylePlay }
  834.  
  835.  
  836. procedure SayGoodbye;
  837. { Say goodbye and then exit the program }
  838. var
  839.   ViewInfo : ViewPortType;
  840. begin
  841.   MainWindow('');
  842.   GetViewSettings(ViewInfo);
  843.   SetTextStyle(TriplexFont, HorizDir, 4);
  844.   SetTextJustify(CenterText, CenterText);
  845.   with ViewInfo do
  846.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  847.   StatusLine('Press any key to quit...');
  848.   repeat until KeyPressed;
  849. end; { SayGoodbye }
  850.  
  851.  
  852. PROCEDURE SelectMode;
  853. VAR
  854.     choice1,choice2     : CHAR;
  855.    xsize,ysize            : WORD;
  856. BEGIN
  857.     (* Let's select a mode *)
  858.     ClrScr;
  859.     WriteLn('VESADEMO:');
  860.     WriteLn('1. 256 colors');
  861.     WriteLn('2. 32768 colors');
  862.     WriteLn('3. 65536 colors');
  863.     WriteLn('4. 16777216 colors');
  864.     WriteLn('Q uit');
  865.     WriteLn;
  866.     Write('Your choice: ');
  867.     REPEAT
  868.         ReadLn(choice1);
  869.       IF choice1 <> '1' THEN BEGIN
  870.           WriteLn('Sorry !');
  871.          WriteLn('This demo wasn''t written for more as 256 colors !');
  872.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  873.          WriteLn('Switching to 256 colors.');
  874.          choice1 := '1';
  875.       END;
  876.     UNTIL choice1 IN ['1'..'4','q'];
  877.     IF choice1 = 'q' THEN Halt;
  878.  
  879.     WriteLn;
  880.     WriteLn;
  881.     WriteLn('a. 320x200');
  882.     WriteLn('b. 640x480');
  883.     WriteLn('c. 800x600');
  884.     WriteLn('d. 1024x768');
  885.     WriteLn('e. 1280x1024');
  886.     WriteLn('Q uit');
  887.     WriteLn;
  888.     Write('Your choice: ');
  889.     REPEAT
  890.         ReadLn(choice2);
  891.     UNTIL choice2 IN ['a'..'e','q'];
  892.     IF choice2 = 'q' THEN Halt;
  893.  
  894.     CASE choice2 OF
  895.         'a' : BEGIN
  896.             xsize := 320;
  897.             ysize := 200;
  898.         END;
  899.         'b' : BEGIN
  900.             xsize := 640;
  901.             ysize := 480;
  902.         END;
  903.         'c' : BEGIN
  904.             xsize := 800;
  905.             ysize := 600;
  906.         END;
  907.         'd' : BEGIN
  908.             xsize := 1024;
  909.             ysize := 768;
  910.         END;
  911.         'e' : BEGIN
  912.             xsize := 1280;
  913.             ysize := 1024;
  914.         END;
  915.     END;
  916.     CASE choice1 OF
  917.         '1' : mode := FindVesaMode(xsize,ysize,8);
  918.         '2' : mode := FindVesaMode(xsize,ysize,15);
  919.         '3' : mode := FindVesaMode(xsize,ysize,16);
  920.         '4' : mode := FindVesaMode(xsize,ysize,24);
  921.     END;
  922.     IF mode = 0 THEN BEGIN
  923.         WriteLn('No such mode could be found !');
  924.         WriteLn('Switching to to 320x200.');
  925.         ReadKey;
  926.         mode := V320x200x256;
  927.     END;
  928. END;
  929.  
  930. begin { program body }
  931.   SelectMode;
  932.   Initialize;
  933.   ReportStatus;
  934.  
  935. {  AspectRatioPlay; }
  936.   FillEllipsePlay;
  937.   SectorPlay;
  938.   WriteModePlay;
  939.  
  940.   ColorPlay;
  941.   { PalettePlay only intended to work on these drivers: }
  942.   if (GraphDriver = EGA) or
  943.       (GraphDriver = EGA64) or
  944.       (GraphDriver = VGA) then
  945.      PalettePlay;
  946.   PutPixelPlay;
  947. {  PutImagePlay; }
  948.   RandBarPlay;
  949.   BarPlay;
  950.   Bar3DPlay;
  951.   ArcPlay;
  952.   CirclePlay;
  953.   PiePlay;
  954.   LineToPlay;
  955.   LineRelPlay;
  956. {  LineStylePlay; }
  957. {  UserLineStylePlay; }
  958.   TextDump;
  959.   TextPlay;
  960.   CrtModePlay;
  961.   FillStylePlay;
  962.   FillPatternPlay;
  963.   PolyPlay;
  964.   SayGoodbye;
  965. {  CloseGraph; }
  966.   CloseVesa;
  967. end.
  968. ***************************************************
  969.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  970.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  971. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  972. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  973.     Color := RandColor;
  974.     SetColor(Color);
  975.     SetFillStyle(Random(CloseDotFill)+1, Color);
  976.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  977.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  978.   until KeyPressed;
  979.   WaitToGo;
  980. end; { RandBarPlay }
  981.  
  982. procedure ArcPlay;
  983. { Draw random arcs on the screen }
  984. var
  985.   MaxRadius : word;
  986.   EndAngle : word;
  987.   ArcInfo : ArcCoordsType;
  988. begin
  989.   MainWindow('Arc / GetArcCoords demonstration');
  990.   StatusLine('Esc aborts or press a key');
  991.   MaxRadius := MaxY div 10;
  992.   repeat
  993.     SetColor(RandColor);
  994.     EndAngle := Random(360);
  995.     SetLineStyle(SolidLn, 0, NormWidth);
  996.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  997.     GetArcCoords(ArcInfo);
  998.     with ArcInfo do
  999.     begin
  1000.       Line(X, Y, XStart, YStart);
  1001.       Line(X, Y, Xend, Yend);
  1002.     end;
  1003.   until KeyPressed;
  1004.   WaitToGo;
  1005. end; { ArcPlay }
  1006.  
  1007. procedure PutPixelPlay;
  1008. { Demonstrate the PutPixel and GetPixel commands }
  1009. const
  1010.   Seed   = 1962; { A seed for the random number generator }
  1011.   NumPts = 2000; { The number of pixels plotted }
  1012.   Esc    = #27;
  1013. var
  1014.   I : word;
  1015.   X, Y, Color : word;
  1016.   XMax, YMax  : integer;
  1017.   ViewInfo    : ViewPortType;
  1018. begin
  1019.   MainWindow('PutPixel / GetPixel demonstration');
  1020.   StatusLine('Esc aborts or press a key...');
  1021.  
  1022.   GetViewSettings(ViewInfo);
  1023.   with ViewInfo do
  1024.   begin
  1025.     XMax := (x2-x1-1);
  1026.     YMax := (y2-y1-1);
  1027.   end;
  1028.  
  1029.   while not KeyPressed do
  1030.   begin
  1031.     { Plot random pixels }
  1032.     RandSeed := Seed;
  1033.     I := 0;
  1034.     while (not KeyPressed) and (I < NumPts) do
  1035.     begin
  1036.       Inc(I);
  1037.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  1038.     end;
  1039.  
  1040.     { Erase pixels }
  1041.     RandSeed := Seed;
  1042.     I := 0;
  1043.     while (not KeyPressed) and (I < NumPts) do
  1044.     begin
  1045.       Inc(I);
  1046.       X := Random(XMax)+1;
  1047.       Y := Random(YMax)+1;
  1048.       Color := GetPixel(X, Y);
  1049.         if Color = RandColor then
  1050.           PutPixel(X, Y, 0);
  1051.      end;
  1052.   end;
  1053.   WaitToGo;
  1054. end; { PutPixelPlay }
  1055.  
  1056. procedure PutImagePlay;
  1057. { Demonstrate the GetImage and PutImage commands }
  1058.  
  1059. const
  1060.   r  = 20;
  1061.   StartX = 100;
  1062.   StartY = 50;
  1063.  
  1064. var
  1065.   CurPort : ViewPortType;
  1066.  
  1067. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  1068. var
  1069.   Step : integer;
  1070. begin
  1071.   Step := Random(2*r);
  1072.   if Odd(Step) then
  1073.     Step := -Step;
  1074.   X := X + Step;
  1075.   Step := Random(r);
  1076.   if Odd(Step) then
  1077.     Step := -Step;
  1078.   Y := Y + Step;
  1079.  
  1080.   { Make saucer bounce off viewport walls }
  1081.   with CurPort do
  1082.   begin
  1083.     if (x1 + X + Width - 1 > x2) then
  1084.       X := x2-x1 - Width + 1
  1085.     else
  1086.       if (X < 0) then
  1087.         X := 0;
  1088.     if (y1 + Y + Height - 1 > y2) then
  1089.       Y := y2-y1 - Height + 1
  1090.     else
  1091.       if (Y < 0) then
  1092.         Y := 0;
  1093.   end;
  1094. end; { MoveSaucer }
  1095.  
  1096. var
  1097.   Pausetime : word;
  1098.   Saucer    : pointer;
  1099.   X, Y      : integer;
  1100.   ulx, uly  : word;
  1101.   lrx, lry  : word;
  1102.   Size      : word;
  1103.   I         : word;
  1104. begin
  1105.   ClearDevice;
  1106.   FullPort;
  1107.  
  1108.   { PaintScreen }
  1109.   ClearDevice;
  1110.   MainWindow('GetImage / PutImage Demonstration');
  1111.   StatusLine('Esc aborts or press a key...');
  1112.   GetViewSettings(CurPort);
  1113.  
  1114.   { DrawSaucer }
  1115.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  1116.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  1117.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  1118.   Circle(StartX+10, StartY-12, 2);
  1119.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  1120.   Circle(StartX-10, StartY-12, 2);
  1121.   SetFillStyle(SolidFill, MaxColor);
  1122.   FloodFill(StartX+1, StartY+4, GetColor);
  1123.  
  1124.   { ReadSaucerImage }
  1125.   ulx := StartX-(r+1);
  1126.   uly := StartY-14;
  1127.   lrx := StartX+(r+1);
  1128.   lry := StartY+(r div 3)+3;
  1129.  
  1130.   Size := ImageSize(ulx, uly, lrx, lry);
  1131.   GetMem(Saucer, Size);
  1132.   GetImage(ulx, uly, lrx, lry, Saucer^);
  1133. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  1134.  
  1135.   { Plot some "stars" }
  1136.   for I := 1 to 1000 do
  1137.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  1138.   X := MaxX div 2;
  1139.   Y := MaxY div 2;
  1140.   PauseTime := 70;
  1141.  
  1142.   { Move the saucer around }
  1143.   repeat
  1144. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  1145.      Delay(PauseTime);
  1146. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  1147.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  1148.   until KeyPressed;
  1149.   FreeMem(Saucer, size);
  1150.   WaitToGo;
  1151. end; { PutImagePlay }
  1152.  
  1153. procedure PolyPlay;
  1154. { Draw random polygons with random fill styles on the screen }
  1155. const
  1156.   MaxPts = 5;
  1157. type
  1158.   PolygonType = array[1..MaxPts] of PointType;
  1159. var
  1160.   Poly : PolygonType;
  1161.   I, Color : word;
  1162. begin
  1163.   MainWindow('FillPoly demonstration');
  1164.   StatusLine('Esc aborts or press a key...');
  1165.   repeat
  1166.     Color := RandColor;
  1167.     SetFillStyle(Random(11)+1, Color);
  1168.     SetColor(Color);
  1169.     for I := 1 to MaxPts do
  1170.       with Poly[I] do
  1171.       begin
  1172.         X := Random(MaxX);
  1173.         Y := Random(MaxY);
  1174.       end;
  1175.     FillPoly(MaxPts, Poly);
  1176.   until KeyPressed;
  1177.   WaitToGo;
  1178. end; { PolyPlay }
  1179.  
  1180. procedure FillStylePlay;
  1181. { Display all of the predefined fill styles available }
  1182. var
  1183.   Style    : word;
  1184.   Width    : word;
  1185.   Height   : word;
  1186.   X, Y     : word;
  1187.   I, J     : word;
  1188.   ViewInfo : ViewPortType;
  1189.  
  1190. procedure DrawBox(X, Y : word);
  1191. begin
  1192.   SetFillStyle(Style, MaxColor);
  1193.   with ViewInfo do
  1194.     Bar(X, Y, X+Width, Y+Height);
  1195.   Rectangle(X, Y, X+Width, Y+Height);
  1196.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  1197.   Inc(Style);
  1198. end; { DrawBox }
  1199.  
  1200. begin
  1201.   MainWindow('Pre-defined fill styles');
  1202.   GetViewSettings(ViewInfo);
  1203.   with ViewInfo do
  1204.   begin
  1205.     Width := 2 * ((x2+1) div 13);
  1206.     Height := 2 * ((y2-10) div 10);
  1207.   end;
  1208.   X := Width div 2;
  1209.   Y := Height div 2;
  1210.   Style := 0;
  1211.   for J := 1 to 3 do
  1212.   begin
  1213.     for I := 1 to 4 do
  1214.     begin
  1215.       DrawBox(X, Y);
  1216.       Inc(X, (Width div 2) * 3);
  1217.     end;
  1218.     X := Width div 2;
  1219.     Inc(Y, (Height div 2) * 3);
  1220.   end;
  1221.   SetTextJustify(LeftText, TopText);
  1222.   WaitToGo;
  1223. end; { FillStylePlay }
  1224.  
  1225. procedure FillPatternPlay;
  1226. { Display some user defined fill patterns }
  1227. const
  1228.   Patterns : array[0..11] of FillPatternType = (
  1229.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  1230.             OldColor which has a path of pixels of OldColor or NewColor
  1231.             with sides touching back to the seed point, (XSeed, YSeed).
  1232.             Therefore, only pixels of OldColor are modified and no other
  1233.             information is changed.
  1234.  
  1235.             SEE ALSO
  1236.  
  1237.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  1238.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  1239.             SETVIEW
  1240.  
  1241.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  1242.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  1243.             IF WHICHVGA = 0 THEN STOP
  1244.             DUMMY=RES640
  1245.             SETVIEW 100, 100, 539, 379
  1246.             FILLVIEW 10
  1247.             WHILE INKEY$ = ""
  1248.             WEND
  1249.             VIDEOMODESET VMODE
  1250.             END
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.  
  1265.  
  1266.  
  1267.                                                                          63
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.           FONTGETINFO
  1274.  
  1275.             PROTOTYPE
  1276.  
  1277.             SUB FONTGETINFO (Width%, Height%)
  1278.  
  1279.             INPUT
  1280.  
  1281.             no input parameters
  1282.     WEND
  1283.             MOUSEEXIT
  1284.             VIDEOMODESET VMODE
  1285.             END
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.                                                                          86
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332.           MOUSECURSORDEFAULT
  1333.  
  1334.             PROTOTYPE
  1335.  
  1336.             SUB MOUSECURSORDEFAULT ()
  1337.  
  1338.             INPUT
  1339.  
  1340.             no input parameters
  1341.  
  1342.             OUTPUT
  1343.  
  1344.             no value returned
  1345.  
  1346.             USAGE
  1347.  
  1348.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  1349.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  1350. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  1351. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  1352. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  1353. $╤
  1354. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  1355. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  1356. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  1357.       end;
  1358.     end;
  1359.   end;
  1360.   WaitToGo;
  1361. end; { UserLineStylePlay }
  1362.  
  1363.  
  1364. procedure SayGoodbye;
  1365. { Say goodbye and then exit the program }
  1366. var
  1367.   ViewInfo : ViewPortType;
  1368. begin
  1369.   MainWindow('');
  1370.   GetViewSettings(ViewInfo);
  1371.   SetTextStyle(TriplexFont, HorizDir, 4);
  1372.   SetTextJustify(CenterText, CenterText);
  1373.   with ViewInfo do
  1374.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  1375.   StatusLine('Press any key to quit...');
  1376.   repeat until KeyPressed;
  1377. end; { SayGoodbye }
  1378.  
  1379.  
  1380. PROCEDURE SelectMode;
  1381. VAR
  1382.     choice1,choice2     : CHAR;
  1383.    xsize,ysize            : WORD;
  1384. BEGIN
  1385.     (* Let's select a mode *)
  1386.     ClrScr;
  1387.     WriteLn('VESADEMO:');
  1388.     WriteLn('1. 256 colors');
  1389.     WriteLn('2. 32768 colors');
  1390.     WriteLn('3. 65536 colors');
  1391.     WriteLn('4. 16777216 colors');
  1392.     WriteLn('Q uit');
  1393.     WriteLn;
  1394.     Write('Your choice: ');
  1395.     REPEAT
  1396.         ReadLn(choice1);
  1397.       IF choice1 <> '1' THEN BEGIN
  1398.           WriteLn('Sorry !');
  1399.          WriteLn('This demo wasn''t written for more as 256 colors !');
  1400.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  1401.          WriteLn('Switching to 256 colors.');
  1402.          choice1 := '1';
  1403.       END;
  1404.     UNTIL choice1 IN ['1'..'4','q'];
  1405.     IF choice1 = 'q' THEN Halt;
  1406.  
  1407.     WriteLn;
  1408.     WriteLn;
  1409.     WriteLn('a. 320x200');
  1410.     WriteLn('b. 640x480');
  1411.     WriteLn('c. 800x600');
  1412.     WriteLn('d. 1024x768');
  1413.     WriteLn('e. 1280x1024');
  1414.     WriteLn('Q uit');
  1415.     WriteLn;
  1416.     Write('Your choice: ');
  1417.     REPEAT
  1418.         ReadLn(choice2);
  1419.     UNTIL choice2 IN ['a'..'e','q'];
  1420.     IF choice2 = 'q' THEN Halt;
  1421.  
  1422.     CASE choice2 OF
  1423.         'a' : BEGIN
  1424.             xsize := 320;
  1425.             ysize := 200;
  1426.         END;
  1427.         'b' : BEGIN
  1428.             xsize := 640;
  1429.             ysize := 480;
  1430.         END;
  1431.         'c' : BEGIN
  1432.             xsize := 800;
  1433.             ysize := 600;
  1434.         END;
  1435.         'd' : BEGIN
  1436.             xsize := 1024;
  1437.             ysize := 768;
  1438.         END;
  1439.         'e' : BEGIN
  1440.             xsize := 1280;
  1441.             ysize := 1024;
  1442.         END;
  1443.     END;
  1444.     CASE choice1 OF
  1445.         '1' : mode := FindVesaMode(xsize,ysize,8);
  1446.         '2' : mode := FindVesaMode(xsize,ysize,15);
  1447.         '3' : mode := FindVesaMode(xsize,ysize,16);
  1448.         '4' : mode := FindVesaMode(xsize,ysize,24);
  1449.     END;
  1450.     IF mode = 0 THEN BEGIN
  1451.         WriteLn('No such mode could be found !');
  1452.         WriteLn('Switching to to 320x200.');
  1453.         ReadKey;
  1454.         mode := V320x200x256;
  1455.     END;
  1456. END;
  1457.  
  1458. begin { program body }
  1459.   SelectMode;
  1460.   Initialize;
  1461.   ReportStatus;
  1462.  
  1463. {  AspectRatioPlay; }
  1464.   FillEllipsePlay;
  1465.   SectorPlay;
  1466.   WriteModePlay;
  1467.  
  1468.   ColorPlay;
  1469.   { PalettePlay only intended to work on these drivers: }
  1470.   if (GraphDriver = EGA) or
  1471.       (GraphDriver = EGA64) or
  1472.       (GraphDriver = VGA) then
  1473.      PalettePlay;
  1474.   PutPixelPlay;
  1475. {  PutImagePlay; }
  1476.   RandBarPlay;
  1477.   BarPlay;
  1478.   Bar3DPlay;
  1479.   ArcPlay;
  1480.   CirclePlay;
  1481.   PiePlay;
  1482.   LineToPlay;
  1483.   LineRelPlay;
  1484. {  LineStylePlay; }
  1485. {  UserLineStylePlay; }
  1486.   TextDump;
  1487.   TextPlay;
  1488.   CrtModePlay;
  1489.   FillStylePlay;
  1490.   FillPatternPlay;
  1491.   PolyPlay;
  1492.   SayGoodbye;
  1493. {  CloseGraph; }
  1494.   CloseVesa;
  1495. end.
  1496. ***************************************************
  1497.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  1498.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  1499. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  1500. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  1501.     Color := RandColor;
  1502.     SetColor(Color);
  1503.     SetFillStyle(Random(CloseDotFill)+1, Color);
  1504.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  1505.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  1506.   until KeyPressed;
  1507.   WaitToGo;
  1508. end; { RandBarPlay }
  1509.  
  1510. procedure ArcPlay;
  1511. { Draw random arcs on the screen }
  1512. var
  1513.   MaxRadius : word;
  1514.   EndAngle : word;
  1515.   ArcInfo : ArcCoordsType;
  1516. begin
  1517.   MainWindow('Arc / GetArcCoords demonstration');
  1518.   StatusLine('Esc aborts or press a key');
  1519.   MaxRadius := MaxY div 10;
  1520.   repeat
  1521.     SetColor(RandColor);
  1522.     EndAngle := Random(360);
  1523.     SetLineStyle(SolidLn, 0, NormWidth);
  1524.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  1525.     GetArcCoords(ArcInfo);
  1526.     with ArcInfo do
  1527.     begin
  1528.       Line(X, Y, XStart, YStart);
  1529.       Line(X, Y, Xend, Yend);
  1530.     end;
  1531.   until KeyPressed;
  1532.   WaitToGo;
  1533. end; { ArcPlay }
  1534.  
  1535. procedure PutPixelPlay;
  1536. { Demonstrate the PutPixel and GetPixel commands }
  1537. const
  1538.   Seed   = 1962; { A seed for the random number generator }
  1539.   NumPts = 2000; { The number of pixels plotted }
  1540.   Esc    = #27;
  1541. var
  1542.   I : word;
  1543.   X, Y, Color : word;
  1544.   XMax, YMax  : integer;
  1545.   ViewInfo    : ViewPortType;
  1546. begin
  1547.   MainWindow('PutPixel / GetPixel demonstration');
  1548.   StatusLine('Esc aborts or press a key...');
  1549.  
  1550.   GetViewSettings(ViewInfo);
  1551.   with ViewInfo do
  1552.   begin
  1553.     XMax := (x2-x1-1);
  1554.     YMax := (y2-y1-1);
  1555.   end;
  1556.  
  1557.   while not KeyPressed do
  1558.   begin
  1559.     { Plot random pixels }
  1560.     RandSeed := Seed;
  1561.     I := 0;
  1562.     while (not KeyPressed) and (I < NumPts) do
  1563.     begin
  1564.       Inc(I);
  1565.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  1566.     end;
  1567.  
  1568.     { Erase pixels }
  1569.     RandSeed := Seed;
  1570.     I := 0;
  1571.     while (not KeyPressed) and (I < NumPts) do
  1572.     begin
  1573.       Inc(I);
  1574.       X := Random(XMax)+1;
  1575.       Y := Random(YMax)+1;
  1576.       Color := GetPixel(X, Y);
  1577.         if Color = RandColor then
  1578.           PutPixel(X, Y, 0);
  1579.      end;
  1580.   end;
  1581.   WaitToGo;
  1582. end; { PutPixelPlay }
  1583.  
  1584. procedure PutImagePlay;
  1585. { Demonstrate the GetImage and PutImage commands }
  1586.  
  1587. const
  1588.   r  = 20;
  1589.   StartX = 100;
  1590.   StartY = 50;
  1591.  
  1592. var
  1593.   CurPort : ViewPortType;
  1594.  
  1595. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  1596. var
  1597.   Step : integer;
  1598. begin
  1599.   Step := Random(2*r);
  1600.   if Odd(Step) then
  1601.     Step := -Step;
  1602.   X := X + Step;
  1603.   Step := Random(r);
  1604.   if Odd(Step) then
  1605.     Step := -Step;
  1606.   Y := Y + Step;
  1607.  
  1608.   { Make saucer bounce off viewport walls }
  1609.   with CurPort do
  1610.   begin
  1611.     if (x1 + X + Width - 1 > x2) then
  1612.       X := x2-x1 - Width + 1
  1613.     else
  1614.       if (X < 0) then
  1615.         X := 0;
  1616.     if (y1 + Y + Height - 1 > y2) then
  1617.       Y := y2-y1 - Height + 1
  1618.     else
  1619.       if (Y < 0) then
  1620.         Y := 0;
  1621.   end;
  1622. end; { MoveSaucer }
  1623.  
  1624. var
  1625.   Pausetime : word;
  1626.   Saucer    : pointer;
  1627.   X, Y      : integer;
  1628.   ulx, uly  : word;
  1629.   lrx, lry  : word;
  1630.   Size      : word;
  1631.   I         : word;
  1632. begin
  1633.   ClearDevice;
  1634.   FullPort;
  1635.  
  1636.   { PaintScreen }
  1637.   ClearDevice;
  1638.   MainWindow('GetImage / PutImage Demonstration');
  1639.   StatusLine('Esc aborts or press a key...');
  1640.   GetViewSettings(CurPort);
  1641.  
  1642.   { DrawSaucer }
  1643.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  1644.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  1645.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  1646.   Circle(StartX+10, StartY-12, 2);
  1647.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  1648.   Circle(StartX-10, StartY-12, 2);
  1649.   SetFillStyle(SolidFill, MaxColor);
  1650.   FloodFill(StartX+1, StartY+4, GetColor);
  1651.  
  1652.   { ReadSaucerImage }
  1653.   ulx := StartX-(r+1);
  1654.   uly := StartY-14;
  1655.   lrx := StartX+(r+1);
  1656.   lry := StartY+(r div 3)+3;
  1657.  
  1658.   Size := ImageSize(ulx, uly, lrx, lry);
  1659.   GetMem(Saucer, Size);
  1660.   GetImage(ulx, uly, lrx, lry, Saucer^);
  1661. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  1662.  
  1663.   { Plot some "stars" }
  1664.   for I := 1 to 1000 do
  1665.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  1666.   X := MaxX div 2;
  1667.   Y := MaxY div 2;
  1668.   PauseTime := 70;
  1669.  
  1670.   { Move the saucer around }
  1671.   repeat
  1672. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  1673.      Delay(PauseTime);
  1674. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  1675.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  1676.   until KeyPressed;
  1677.   FreeMem(Saucer, size);
  1678.   WaitToGo;
  1679. end; { PutImagePlay }
  1680.  
  1681. procedure PolyPlay;
  1682. { Draw random polygons with random fill styles on the screen }
  1683. const
  1684.   MaxPts = 5;
  1685. type
  1686.   PolygonType = array[1..MaxPts] of PointType;
  1687. var
  1688.   Poly : PolygonType;
  1689.   I, Color : word;
  1690. begin
  1691.   MainWindow('FillPoly demonstration');
  1692.   StatusLine('Esc aborts or press a key...');
  1693.   repeat
  1694.     Color := RandColor;
  1695.     SetFillStyle(Random(11)+1, Color);
  1696.     SetColor(Color);
  1697.     for I := 1 to MaxPts do
  1698.       with Poly[I] do
  1699.       begin
  1700.         X := Random(MaxX);
  1701.         Y := Random(MaxY);
  1702.       end;
  1703.     FillPoly(MaxPts, Poly);
  1704.   until KeyPressed;
  1705.   WaitToGo;
  1706. end; { PolyPlay }
  1707.  
  1708. procedure FillStylePlay;
  1709. { Display all of the predefined fill styles available }
  1710. var
  1711.   Style    : word;
  1712.   Width    : word;
  1713.   Height   : word;
  1714.   X, Y     : word;
  1715.   I, J     : word;
  1716.   ViewInfo : ViewPortType;
  1717.  
  1718. procedure DrawBox(X, Y : word);
  1719. begin
  1720.   SetFillStyle(Style, MaxColor);
  1721.   with ViewInfo do
  1722.     Bar(X, Y, X+Width, Y+Height);
  1723.   Rectangle(X, Y, X+Width, Y+Height);
  1724.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  1725.   Inc(Style);
  1726. end; { DrawBox }
  1727.  
  1728. begin
  1729.   MainWindow('Pre-defined fill styles');
  1730.   GetViewSettings(ViewInfo);
  1731.   with ViewInfo do
  1732.   begin
  1733.     Width := 2 * ((x2+1) div 13);
  1734.     Height := 2 * ((y2-10) div 10);
  1735.   end;
  1736.   X := Width div 2;
  1737.   Y := Height div 2;
  1738.   Style := 0;
  1739.   for J := 1 to 3 do
  1740.   begin
  1741.     for I := 1 to 4 do
  1742.     begin
  1743.       DrawBox(X, Y);
  1744.       Inc(X, (Width div 2) * 3);
  1745.     end;
  1746.     X := Width div 2;
  1747.     Inc(Y, (Height div 2) * 3);
  1748.   end;
  1749.   SetTextJustify(LeftText, TopText);
  1750.   WaitToGo;
  1751. end; { FillStylePlay }
  1752.  
  1753. procedure FillPatternPlay;
  1754. { Display some user defined fill patterns }
  1755. const
  1756.   Patterns : array[0..11] of FillPatternType = (
  1757.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  1758.             OldColor which has a path of pixels of OldColor or NewColor
  1759.             with sides touching back to the seed point, (XSeed, YSeed).
  1760.             Therefore, only pixels of OldColor are modified and no other
  1761.             information is changed.
  1762.  
  1763.             SEE ALSO
  1764.  
  1765.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  1766.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  1767.             SETVIEW
  1768.  
  1769.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  1770.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  1771.             IF WHICHVGA = 0 THEN STOP
  1772.             DUMMY=RES640
  1773.             SETVIEW 100, 100, 539, 379
  1774.             FILLVIEW 10
  1775.             WHILE INKEY$ = ""
  1776.             WEND
  1777.             VIDEOMODESET VMODE
  1778.             END
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794.  
  1795.                                                                          63
  1796.  
  1797.  
  1798.  
  1799.  
  1800.  
  1801.           FONTGETINFO
  1802.  
  1803.             PROTOTYPE
  1804.  
  1805.             SUB FONTGETINFO (Width%, Height%)
  1806.  
  1807.             INPUT
  1808.  
  1809.             no input parameters
  1810.     WEND
  1811.             MOUSEEXIT
  1812.             VIDEOMODESET VMODE
  1813.             END
  1814.  
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.                                                                          86
  1855.  
  1856.  
  1857.  
  1858.  
  1859.  
  1860.           MOUSECURSORDEFAULT
  1861.  
  1862.             PROTOTYPE
  1863.  
  1864.             SUB MOUSECURSORDEFAULT ()
  1865.  
  1866.             INPUT
  1867.  
  1868.             no input parameters
  1869.  
  1870.             OUTPUT
  1871.  
  1872.             no value returned
  1873.  
  1874.             USAGE
  1875.  
  1876.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  1877.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  1878. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  1879. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  1880. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  1881. $╤
  1882. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  1883. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  1884. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  1885.       end;
  1886.     end;
  1887.   end;
  1888.   WaitToGo;
  1889. end; { UserLineStylePlay }
  1890.  
  1891.  
  1892. procedure SayGoodbye;
  1893. { Say goodbye and then exit the program }
  1894. var
  1895.   ViewInfo : ViewPortType;
  1896. begin
  1897.   MainWindow('');
  1898.   GetViewSettings(ViewInfo);
  1899.   SetTextStyle(TriplexFont, HorizDir, 4);
  1900.   SetTextJustify(CenterText, CenterText);
  1901.   with ViewInfo do
  1902.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  1903.   StatusLine('Press any key to quit...');
  1904.   repeat until KeyPressed;
  1905. end; { SayGoodbye }
  1906.  
  1907.  
  1908. PROCEDURE SelectMode;
  1909. VAR
  1910.     choice1,choice2     : CHAR;
  1911.    xsize,ysize            : WORD;
  1912. BEGIN
  1913.     (* Let's select a mode *)
  1914.     ClrScr;
  1915.     WriteLn('VESADEMO:');
  1916.     WriteLn('1. 256 colors');
  1917.     WriteLn('2. 32768 colors');
  1918.     WriteLn('3. 65536 colors');
  1919.     WriteLn('4. 16777216 colors');
  1920.     WriteLn('Q uit');
  1921.     WriteLn;
  1922.     Write('Your choice: ');
  1923.     REPEAT
  1924.         ReadLn(choice1);
  1925.       IF choice1 <> '1' THEN BEGIN
  1926.           WriteLn('Sorry !');
  1927.          WriteLn('This demo wasn''t written for more as 256 colors !');
  1928.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  1929.          WriteLn('Switching to 256 colors.');
  1930.          choice1 := '1';
  1931.       END;
  1932.     UNTIL choice1 IN ['1'..'4','q'];
  1933.     IF choice1 = 'q' THEN Halt;
  1934.  
  1935.     WriteLn;
  1936.     WriteLn;
  1937.     WriteLn('a. 320x200');
  1938.     WriteLn('b. 640x480');
  1939.     WriteLn('c. 800x600');
  1940.     WriteLn('d. 1024x768');
  1941.     WriteLn('e. 1280x1024');
  1942.     WriteLn('Q uit');
  1943.     WriteLn;
  1944.     Write('Your choice: ');
  1945.     REPEAT
  1946.         ReadLn(choice2);
  1947.     UNTIL choice2 IN ['a'..'e','q'];
  1948.     IF choice2 = 'q' THEN Halt;
  1949.  
  1950.     CASE choice2 OF
  1951.         'a' : BEGIN
  1952.             xsize := 320;
  1953.             ysize := 200;
  1954.         END;
  1955.         'b' : BEGIN
  1956.             xsize := 640;
  1957.             ysize := 480;
  1958.         END;
  1959.         'c' : BEGIN
  1960.             xsize := 800;
  1961.             ysize := 600;
  1962.         END;
  1963.         'd' : BEGIN
  1964.             xsize := 1024;
  1965.             ysize := 768;
  1966.         END;
  1967.         'e' : BEGIN
  1968.             xsize := 1280;
  1969.             ysize := 1024;
  1970.         END;
  1971.     END;
  1972.     CASE choice1 OF
  1973.         '1' : mode := FindVesaMode(xsize,ysize,8);
  1974.         '2' : mode := FindVesaMode(xsize,ysize,15);
  1975.         '3' : mode := FindVesaMode(xsize,ysize,16);
  1976.         '4' : mode := FindVesaMode(xsize,ysize,24);
  1977.     END;
  1978.     IF mode = 0 THEN BEGIN
  1979.         WriteLn('No such mode could be found !');
  1980.         WriteLn('Switching to to 320x200.');
  1981.         ReadKey;
  1982.         mode := V320x200x256;
  1983.     END;
  1984. END;
  1985.  
  1986. begin { program body }
  1987.   SelectMode;
  1988.   Initialize;
  1989.   ReportStatus;
  1990.  
  1991. {  AspectRatioPlay; }
  1992.   FillEllipsePlay;
  1993.   SectorPlay;
  1994.   WriteModePlay;
  1995.  
  1996.   ColorPlay;
  1997.   { PalettePlay only intended to work on these drivers: }
  1998.   if (GraphDriver = EGA) or
  1999.       (GraphDriver = EGA64) or
  2000.       (GraphDriver = VGA) then
  2001.      PalettePlay;
  2002.   PutPixelPlay;
  2003. {  PutImagePlay; }
  2004.   RandBarPlay;
  2005.   BarPlay;
  2006.   Bar3DPlay;
  2007.   ArcPlay;
  2008.   CirclePlay;
  2009.   PiePlay;
  2010.   LineToPlay;
  2011.   LineRelPlay;
  2012. {  LineStylePlay; }
  2013. {  UserLineStylePlay; }
  2014.   TextDump;
  2015.   TextPlay;
  2016.   CrtModePlay;
  2017.   FillStylePlay;
  2018.   FillPatternPlay;
  2019.   PolyPlay;
  2020.   SayGoodbye;
  2021. {  CloseGraph; }
  2022.   CloseVesa;
  2023. end.
  2024. ***************************************************
  2025.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  2026.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  2027. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  2028. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  2029.     Color := RandColor;
  2030.     SetColor(Color);
  2031.     SetFillStyle(Random(CloseDotFill)+1, Color);
  2032.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  2033.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  2034.   until KeyPressed;
  2035.   WaitToGo;
  2036. end; { RandBarPlay }
  2037.  
  2038. procedure ArcPlay;
  2039. { Draw random arcs on the screen }
  2040. var
  2041.   MaxRadius : word;
  2042.   EndAngle : word;
  2043.   ArcInfo : ArcCoordsType;
  2044. begin
  2045.   MainWindow('Arc / GetArcCoords demonstration');
  2046.   StatusLine('Esc aborts or press a key');
  2047.   MaxRadius := MaxY div 10;
  2048.   repeat
  2049.     SetColor(RandColor);
  2050.     EndAngle := Random(360);
  2051.     SetLineStyle(SolidLn, 0, NormWidth);
  2052.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  2053.     GetArcCoords(ArcInfo);
  2054.     with ArcInfo do
  2055.     begin
  2056.       Line(X, Y, XStart, YStart);
  2057.       Line(X, Y, Xend, Yend);
  2058.     end;
  2059.   until KeyPressed;
  2060.   WaitToGo;
  2061. end; { ArcPlay }
  2062.  
  2063. procedure PutPixelPlay;
  2064. { Demonstrate the PutPixel and GetPixel commands }
  2065. const
  2066.   Seed   = 1962; { A seed for the random number generator }
  2067.   NumPts = 2000; { The number of pixels plotted }
  2068.   Esc    = #27;
  2069. var
  2070.   I : word;
  2071.   X, Y, Color : word;
  2072.   XMax, YMax  : integer;
  2073.   ViewInfo    : ViewPortType;
  2074. begin
  2075.   MainWindow('PutPixel / GetPixel demonstration');
  2076.   StatusLine('Esc aborts or press a key...');
  2077.  
  2078.   GetViewSettings(ViewInfo);
  2079.   with ViewInfo do
  2080.   begin
  2081.     XMax := (x2-x1-1);
  2082.     YMax := (y2-y1-1);
  2083.   end;
  2084.  
  2085.   while not KeyPressed do
  2086.   begin
  2087.     { Plot random pixels }
  2088.     RandSeed := Seed;
  2089.     I := 0;
  2090.     while (not KeyPressed) and (I < NumPts) do
  2091.     begin
  2092.       Inc(I);
  2093.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  2094.     end;
  2095.  
  2096.     { Erase pixels }
  2097.     RandSeed := Seed;
  2098.     I := 0;
  2099.     while (not KeyPressed) and (I < NumPts) do
  2100.     begin
  2101.       Inc(I);
  2102.       X := Random(XMax)+1;
  2103.       Y := Random(YMax)+1;
  2104.       Color := GetPixel(X, Y);
  2105.         if Color = RandColor then
  2106.           PutPixel(X, Y, 0);
  2107.      end;
  2108.   end;
  2109.   WaitToGo;
  2110. end; { PutPixelPlay }
  2111.  
  2112. procedure PutImagePlay;
  2113. { Demonstrate the GetImage and PutImage commands }
  2114.  
  2115. const
  2116.   r  = 20;
  2117.   StartX = 100;
  2118.   StartY = 50;
  2119.  
  2120. var
  2121.   CurPort : ViewPortType;
  2122.  
  2123. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  2124. var
  2125.   Step : integer;
  2126. begin
  2127.   Step := Random(2*r);
  2128.   if Odd(Step) then
  2129.     Step := -Step;
  2130.   X := X + Step;
  2131.   Step := Random(r);
  2132.   if Odd(Step) then
  2133.     Step := -Step;
  2134.   Y := Y + Step;
  2135.  
  2136.   { Make saucer bounce off viewport walls }
  2137.   with CurPort do
  2138.   begin
  2139.     if (x1 + X + Width - 1 > x2) then
  2140.       X := x2-x1 - Width + 1
  2141.     else
  2142.       if (X < 0) then
  2143.         X := 0;
  2144.     if (y1 + Y + Height - 1 > y2) then
  2145.       Y := y2-y1 - Height + 1
  2146.     else
  2147.       if (Y < 0) then
  2148.         Y := 0;
  2149.   end;
  2150. end; { MoveSaucer }
  2151.  
  2152. var
  2153.   Pausetime : word;
  2154.   Saucer    : pointer;
  2155.   X, Y      : integer;
  2156.   ulx, uly  : word;
  2157.   lrx, lry  : word;
  2158.   Size      : word;
  2159.   I         : word;
  2160. begin
  2161.   ClearDevice;
  2162.   FullPort;
  2163.  
  2164.   { PaintScreen }
  2165.   ClearDevice;
  2166.   MainWindow('GetImage / PutImage Demonstration');
  2167.   StatusLine('Esc aborts or press a key...');
  2168.   GetViewSettings(CurPort);
  2169.  
  2170.   { DrawSaucer }
  2171.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  2172.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  2173.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  2174.   Circle(StartX+10, StartY-12, 2);
  2175.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  2176.   Circle(StartX-10, StartY-12, 2);
  2177.   SetFillStyle(SolidFill, MaxColor);
  2178.   FloodFill(StartX+1, StartY+4, GetColor);
  2179.  
  2180.   { ReadSaucerImage }
  2181.   ulx := StartX-(r+1);
  2182.   uly := StartY-14;
  2183.   lrx := StartX+(r+1);
  2184.   lry := StartY+(r div 3)+3;
  2185.  
  2186.   Size := ImageSize(ulx, uly, lrx, lry);
  2187.   GetMem(Saucer, Size);
  2188.   GetImage(ulx, uly, lrx, lry, Saucer^);
  2189. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  2190.  
  2191.   { Plot some "stars" }
  2192.   for I := 1 to 1000 do
  2193.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  2194.   X := MaxX div 2;
  2195.   Y := MaxY div 2;
  2196.   PauseTime := 70;
  2197.  
  2198.   { Move the saucer around }
  2199.   repeat
  2200. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  2201.      Delay(PauseTime);
  2202. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  2203.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  2204.   until KeyPressed;
  2205.   FreeMem(Saucer, size);
  2206.   WaitToGo;
  2207. end; { PutImagePlay }
  2208.  
  2209. procedure PolyPlay;
  2210. { Draw random polygons with random fill styles on the screen }
  2211. const
  2212.   MaxPts = 5;
  2213. type
  2214.   PolygonType = array[1..MaxPts] of PointType;
  2215. var
  2216.   Poly : PolygonType;
  2217.   I, Color : word;
  2218. begin
  2219.   MainWindow('FillPoly demonstration');
  2220.   StatusLine('Esc aborts or press a key...');
  2221.   repeat
  2222.     Color := RandColor;
  2223.     SetFillStyle(Random(11)+1, Color);
  2224.     SetColor(Color);
  2225.     for I := 1 to MaxPts do
  2226.       with Poly[I] do
  2227.       begin
  2228.         X := Random(MaxX);
  2229.         Y := Random(MaxY);
  2230.       end;
  2231.     FillPoly(MaxPts, Poly);
  2232.   until KeyPressed;
  2233.   WaitToGo;
  2234. end; { PolyPlay }
  2235.  
  2236. procedure FillStylePlay;
  2237. { Display all of the predefined fill styles available }
  2238. var
  2239.   Style    : word;
  2240.   Width    : word;
  2241.   Height   : word;
  2242.   X, Y     : word;
  2243.   I, J     : word;
  2244.   ViewInfo : ViewPortType;
  2245.  
  2246. procedure DrawBox(X, Y : word);
  2247. begin
  2248.   SetFillStyle(Style, MaxColor);
  2249.   with ViewInfo do
  2250.     Bar(X, Y, X+Width, Y+Height);
  2251.   Rectangle(X, Y, X+Width, Y+Height);
  2252.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  2253.   Inc(Style);
  2254. end; { DrawBox }
  2255.  
  2256. begin
  2257.   MainWindow('Pre-defined fill styles');
  2258.   GetViewSettings(ViewInfo);
  2259.   with ViewInfo do
  2260.   begin
  2261.     Width := 2 * ((x2+1) div 13);
  2262.     Height := 2 * ((y2-10) div 10);
  2263.   end;
  2264.   X := Width div 2;
  2265.   Y := Height div 2;
  2266.   Style := 0;
  2267.   for J := 1 to 3 do
  2268.   begin
  2269.     for I := 1 to 4 do
  2270.     begin
  2271.       DrawBox(X, Y);
  2272.       Inc(X, (Width div 2) * 3);
  2273.     end;
  2274.     X := Width div 2;
  2275.     Inc(Y, (Height div 2) * 3);
  2276.   end;
  2277.   SetTextJustify(LeftText, TopText);
  2278.   WaitToGo;
  2279. end; { FillStylePlay }
  2280.  
  2281. procedure FillPatternPlay;
  2282. { Display some user defined fill patterns }
  2283. const
  2284.   Patterns : array[0..11] of FillPatternType = (
  2285.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  2286.             OldColor which has a path of pixels of OldColor or NewColor
  2287.             with sides touching back to the seed point, (XSeed, YSeed).
  2288.             Therefore, only pixels of OldColor are modified and no other
  2289.             information is changed.
  2290.  
  2291.             SEE ALSO
  2292.  
  2293.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  2294.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  2295.             SETVIEW
  2296.  
  2297.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  2298.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  2299.             IF WHICHVGA = 0 THEN STOP
  2300.             DUMMY=RES640
  2301.             SETVIEW 100, 100, 539, 379
  2302.             FILLVIEW 10
  2303.             WHILE INKEY$ = ""
  2304.             WEND
  2305.             VIDEOMODESET VMODE
  2306.             END
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.  
  2318.  
  2319.  
  2320.  
  2321.  
  2322.  
  2323.                                                                          63
  2324.  
  2325.  
  2326.  
  2327.  
  2328.  
  2329.           FONTGETINFO
  2330.  
  2331.             PROTOTYPE
  2332.  
  2333.             SUB FONTGETINFO (Width%, Height%)
  2334.  
  2335.             INPUT
  2336.  
  2337.             no input parameters
  2338.     WEND
  2339.             MOUSEEXIT
  2340.             VIDEOMODESET VMODE
  2341.             END
  2342.  
  2343.  
  2344.  
  2345.  
  2346.  
  2347.  
  2348.  
  2349.  
  2350.  
  2351.  
  2352.  
  2353.  
  2354.  
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.                                                                          86
  2383.  
  2384.  
  2385.  
  2386.  
  2387.  
  2388.           MOUSECURSORDEFAULT
  2389.  
  2390.             PROTOTYPE
  2391.  
  2392.             SUB MOUSECURSORDEFAULT ()
  2393.  
  2394.             INPUT
  2395.  
  2396.             no input parameters
  2397.  
  2398.             OUTPUT
  2399.  
  2400.             no value returned
  2401.  
  2402.             USAGE
  2403.  
  2404.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  2405.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  2406. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  2407. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  2408. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  2409. $╤
  2410. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  2411. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  2412. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  2413.       end;
  2414.     end;
  2415.   end;
  2416.   WaitToGo;
  2417. end; { UserLineStylePlay }
  2418.  
  2419.  
  2420. procedure SayGoodbye;
  2421. { Say goodbye and then exit the program }
  2422. var
  2423.   ViewInfo : ViewPortType;
  2424. begin
  2425.   MainWindow('');
  2426.   GetViewSettings(ViewInfo);
  2427.   SetTextStyle(TriplexFont, HorizDir, 4);
  2428.   SetTextJustify(CenterText, CenterText);
  2429.   with ViewInfo do
  2430.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  2431.   StatusLine('Press any key to quit...');
  2432.   repeat until KeyPressed;
  2433. end; { SayGoodbye }
  2434.  
  2435.  
  2436. PROCEDURE SelectMode;
  2437. VAR
  2438.     choice1,choice2     : CHAR;
  2439.    xsize,ysize            : WORD;
  2440. BEGIN
  2441.     (* Let's select a mode *)
  2442.     ClrScr;
  2443.     WriteLn('VESADEMO:');
  2444.     WriteLn('1. 256 colors');
  2445.     WriteLn('2. 32768 colors');
  2446.     WriteLn('3. 65536 colors');
  2447.     WriteLn('4. 16777216 colors');
  2448.     WriteLn('Q uit');
  2449.     WriteLn;
  2450.     Write('Your choice: ');
  2451.     REPEAT
  2452.         ReadLn(choice1);
  2453.       IF choice1 <> '1' THEN BEGIN
  2454.           WriteLn('Sorry !');
  2455.          WriteLn('This demo wasn''t written for more as 256 colors !');
  2456.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  2457.          WriteLn('Switching to 256 colors.');
  2458.          choice1 := '1';
  2459.       END;
  2460.     UNTIL choice1 IN ['1'..'4','q'];
  2461.     IF choice1 = 'q' THEN Halt;
  2462.  
  2463.     WriteLn;
  2464.     WriteLn;
  2465.     WriteLn('a. 320x200');
  2466.     WriteLn('b. 640x480');
  2467.     WriteLn('c. 800x600');
  2468.     WriteLn('d. 1024x768');
  2469.     WriteLn('e. 1280x1024');
  2470.     WriteLn('Q uit');
  2471.     WriteLn;
  2472.     Write('Your choice: ');
  2473.     REPEAT
  2474.         ReadLn(choice2);
  2475.     UNTIL choice2 IN ['a'..'e','q'];
  2476.     IF choice2 = 'q' THEN Halt;
  2477.  
  2478.     CASE choice2 OF
  2479.         'a' : BEGIN
  2480.             xsize := 320;
  2481.             ysize := 200;
  2482.         END;
  2483.         'b' : BEGIN
  2484.             xsize := 640;
  2485.             ysize := 480;
  2486.         END;
  2487.         'c' : BEGIN
  2488.             xsize := 800;
  2489.             ysize := 600;
  2490.         END;
  2491.         'd' : BEGIN
  2492.             xsize := 1024;
  2493.             ysize := 768;
  2494.         END;
  2495.         'e' : BEGIN
  2496.             xsize := 1280;
  2497.             ysize := 1024;
  2498.         END;
  2499.     END;
  2500.     CASE choice1 OF
  2501.         '1' : mode := FindVesaMode(xsize,ysize,8);
  2502.         '2' : mode := FindVesaMode(xsize,ysize,15);
  2503.         '3' : mode := FindVesaMode(xsize,ysize,16);
  2504.         '4' : mode := FindVesaMode(xsize,ysize,24);
  2505.     END;
  2506.     IF mode = 0 THEN BEGIN
  2507.         WriteLn('No such mode could be found !');
  2508.         WriteLn('Switching to to 320x200.');
  2509.         ReadKey;
  2510.         mode := V320x200x256;
  2511.     END;
  2512. END;
  2513.  
  2514. begin { program body }
  2515.   SelectMode;
  2516.   Initialize;
  2517.   ReportStatus;
  2518.  
  2519. {  AspectRatioPlay; }
  2520.   FillEllipsePlay;
  2521.   SectorPlay;
  2522.   WriteModePlay;
  2523.  
  2524.   ColorPlay;
  2525.   { PalettePlay only intended to work on these drivers: }
  2526.   if (GraphDriver = EGA) or
  2527.       (GraphDriver = EGA64) or
  2528.       (GraphDriver = VGA) then
  2529.      PalettePlay;
  2530.   PutPixelPlay;
  2531. {  PutImagePlay; }
  2532.   RandBarPlay;
  2533.   BarPlay;
  2534.   Bar3DPlay;
  2535.   ArcPlay;
  2536.   CirclePlay;
  2537.   PiePlay;
  2538.   LineToPlay;
  2539.   LineRelPlay;
  2540. {  LineStylePlay; }
  2541. {  UserLineStylePlay; }
  2542.   TextDump;
  2543.   TextPlay;
  2544.   CrtModePlay;
  2545.   FillStylePlay;
  2546.   FillPatternPlay;
  2547.   PolyPlay;
  2548.   SayGoodbye;
  2549. {  CloseGraph; }
  2550.   CloseVesa;
  2551. end.
  2552. ***************************************************
  2553.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  2554.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  2555. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  2556. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  2557.     Color := RandColor;
  2558.     SetColor(Color);
  2559.     SetFillStyle(Random(CloseDotFill)+1, Color);
  2560.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  2561.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  2562.   until KeyPressed;
  2563.   WaitToGo;
  2564. end; { RandBarPlay }
  2565.  
  2566. procedure ArcPlay;
  2567. { Draw random arcs on the screen }
  2568. var
  2569.   MaxRadius : word;
  2570.   EndAngle : word;
  2571.   ArcInfo : ArcCoordsType;
  2572. begin
  2573.   MainWindow('Arc / GetArcCoords demonstration');
  2574.   StatusLine('Esc aborts or press a key');
  2575.   MaxRadius := MaxY div 10;
  2576.   repeat
  2577.     SetColor(RandColor);
  2578.     EndAngle := Random(360);
  2579.     SetLineStyle(SolidLn, 0, NormWidth);
  2580.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  2581.     GetArcCoords(ArcInfo);
  2582.     with ArcInfo do
  2583.     begin
  2584.       Line(X, Y, XStart, YStart);
  2585.       Line(X, Y, Xend, Yend);
  2586.     end;
  2587.   until KeyPressed;
  2588.   WaitToGo;
  2589. end; { ArcPlay }
  2590.  
  2591. procedure PutPixelPlay;
  2592. { Demonstrate the PutPixel and GetPixel commands }
  2593. const
  2594.   Seed   = 1962; { A seed for the random number generator }
  2595.   NumPts = 2000; { The number of pixels plotted }
  2596.   Esc    = #27;
  2597. var
  2598.   I : word;
  2599.   X, Y, Color : word;
  2600.   XMax, YMax  : integer;
  2601.   ViewInfo    : ViewPortType;
  2602. begin
  2603.   MainWindow('PutPixel / GetPixel demonstration');
  2604.   StatusLine('Esc aborts or press a key...');
  2605.  
  2606.   GetViewSettings(ViewInfo);
  2607.   with ViewInfo do
  2608.   begin
  2609.     XMax := (x2-x1-1);
  2610.     YMax := (y2-y1-1);
  2611.   end;
  2612.  
  2613.   while not KeyPressed do
  2614.   begin
  2615.     { Plot random pixels }
  2616.     RandSeed := Seed;
  2617.     I := 0;
  2618.     while (not KeyPressed) and (I < NumPts) do
  2619.     begin
  2620.       Inc(I);
  2621.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  2622.     end;
  2623.  
  2624.     { Erase pixels }
  2625.     RandSeed := Seed;
  2626.     I := 0;
  2627.     while (not KeyPressed) and (I < NumPts) do
  2628.     begin
  2629.       Inc(I);
  2630.       X := Random(XMax)+1;
  2631.       Y := Random(YMax)+1;
  2632.       Color := GetPixel(X, Y);
  2633.         if Color = RandColor then
  2634.           PutPixel(X, Y, 0);
  2635.      end;
  2636.   end;
  2637.   WaitToGo;
  2638. end; { PutPixelPlay }
  2639.  
  2640. procedure PutImagePlay;
  2641. { Demonstrate the GetImage and PutImage commands }
  2642.  
  2643. const
  2644.   r  = 20;
  2645.   StartX = 100;
  2646.   StartY = 50;
  2647.  
  2648. var
  2649.   CurPort : ViewPortType;
  2650.  
  2651. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  2652. var
  2653.   Step : integer;
  2654. begin
  2655.   Step := Random(2*r);
  2656.   if Odd(Step) then
  2657.     Step := -Step;
  2658.   X := X + Step;
  2659.   Step := Random(r);
  2660.   if Odd(Step) then
  2661.     Step := -Step;
  2662.   Y := Y + Step;
  2663.  
  2664.   { Make saucer bounce off viewport walls }
  2665.   with CurPort do
  2666.   begin
  2667.     if (x1 + X + Width - 1 > x2) then
  2668.       X := x2-x1 - Width + 1
  2669.     else
  2670.       if (X < 0) then
  2671.         X := 0;
  2672.     if (y1 + Y + Height - 1 > y2) then
  2673.       Y := y2-y1 - Height + 1
  2674.     else
  2675.       if (Y < 0) then
  2676.         Y := 0;
  2677.   end;
  2678. end; { MoveSaucer }
  2679.  
  2680. var
  2681.   Pausetime : word;
  2682.   Saucer    : pointer;
  2683.   X, Y      : integer;
  2684.   ulx, uly  : word;
  2685.   lrx, lry  : word;
  2686.   Size      : word;
  2687.   I         : word;
  2688. begin
  2689.   ClearDevice;
  2690.   FullPort;
  2691.  
  2692.   { PaintScreen }
  2693.   ClearDevice;
  2694.   MainWindow('GetImage / PutImage Demonstration');
  2695.   StatusLine('Esc aborts or press a key...');
  2696.   GetViewSettings(CurPort);
  2697.  
  2698.   { DrawSaucer }
  2699.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  2700.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  2701.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  2702.   Circle(StartX+10, StartY-12, 2);
  2703.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  2704.   Circle(StartX-10, StartY-12, 2);
  2705.   SetFillStyle(SolidFill, MaxColor);
  2706.   FloodFill(StartX+1, StartY+4, GetColor);
  2707.  
  2708.   { ReadSaucerImage }
  2709.   ulx := StartX-(r+1);
  2710.   uly := StartY-14;
  2711.   lrx := StartX+(r+1);
  2712.   lry := StartY+(r div 3)+3;
  2713.  
  2714.   Size := ImageSize(ulx, uly, lrx, lry);
  2715.   GetMem(Saucer, Size);
  2716.   GetImage(ulx, uly, lrx, lry, Saucer^);
  2717. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  2718.  
  2719.   { Plot some "stars" }
  2720.   for I := 1 to 1000 do
  2721.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  2722.   X := MaxX div 2;
  2723.   Y := MaxY div 2;
  2724.   PauseTime := 70;
  2725.  
  2726.   { Move the saucer around }
  2727.   repeat
  2728. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  2729.      Delay(PauseTime);
  2730. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  2731.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  2732.   until KeyPressed;
  2733.   FreeMem(Saucer, size);
  2734.   WaitToGo;
  2735. end; { PutImagePlay }
  2736.  
  2737. procedure PolyPlay;
  2738. { Draw random polygons with random fill styles on the screen }
  2739. const
  2740.   MaxPts = 5;
  2741. type
  2742.   PolygonType = array[1..MaxPts] of PointType;
  2743. var
  2744.   Poly : PolygonType;
  2745.   I, Color : word;
  2746. begin
  2747.   MainWindow('FillPoly demonstration');
  2748.   StatusLine('Esc aborts or press a key...');
  2749.   repeat
  2750.     Color := RandColor;
  2751.     SetFillStyle(Random(11)+1, Color);
  2752.     SetColor(Color);
  2753.     for I := 1 to MaxPts do
  2754.       with Poly[I] do
  2755.       begin
  2756.         X := Random(MaxX);
  2757.         Y := Random(MaxY);
  2758.       end;
  2759.     FillPoly(MaxPts, Poly);
  2760.   until KeyPressed;
  2761.   WaitToGo;
  2762. end; { PolyPlay }
  2763.  
  2764. procedure FillStylePlay;
  2765. { Display all of the predefined fill styles available }
  2766. var
  2767.   Style    : word;
  2768.   Width    : word;
  2769.   Height   : word;
  2770.   X, Y     : word;
  2771.   I, J     : word;
  2772.   ViewInfo : ViewPortType;
  2773.  
  2774. procedure DrawBox(X, Y : word);
  2775. begin
  2776.   SetFillStyle(Style, MaxColor);
  2777.   with ViewInfo do
  2778.     Bar(X, Y, X+Width, Y+Height);
  2779.   Rectangle(X, Y, X+Width, Y+Height);
  2780.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  2781.   Inc(Style);
  2782. end; { DrawBox }
  2783.  
  2784. begin
  2785.   MainWindow('Pre-defined fill styles');
  2786.   GetViewSettings(ViewInfo);
  2787.   with ViewInfo do
  2788.   begin
  2789.     Width := 2 * ((x2+1) div 13);
  2790.     Height := 2 * ((y2-10) div 10);
  2791.   end;
  2792.   X := Width div 2;
  2793.   Y := Height div 2;
  2794.   Style := 0;
  2795.   for J := 1 to 3 do
  2796.   begin
  2797.     for I := 1 to 4 do
  2798.     begin
  2799.       DrawBox(X, Y);
  2800.       Inc(X, (Width div 2) * 3);
  2801.     end;
  2802.     X := Width div 2;
  2803.     Inc(Y, (Height div 2) * 3);
  2804.   end;
  2805.   SetTextJustify(LeftText, TopText);
  2806.   WaitToGo;
  2807. end; { FillStylePlay }
  2808.  
  2809. procedure FillPatternPlay;
  2810. { Display some user defined fill patterns }
  2811. const
  2812.   Patterns : array[0..11] of FillPatternType = (
  2813.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  2814.             OldColor which has a path of pixels of OldColor or NewColor
  2815.             with sides touching back to the seed point, (XSeed, YSeed).
  2816.             Therefore, only pixels of OldColor are modified and no other
  2817.             information is changed.
  2818.  
  2819.             SEE ALSO
  2820.  
  2821.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  2822.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  2823.             SETVIEW
  2824.  
  2825.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  2826.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  2827.             IF WHICHVGA = 0 THEN STOP
  2828.             DUMMY=RES640
  2829.             SETVIEW 100, 100, 539, 379
  2830.             FILLVIEW 10
  2831.             WHILE INKEY$ = ""
  2832.             WEND
  2833.             VIDEOMODESET VMODE
  2834.             END
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843.  
  2844.  
  2845.  
  2846.  
  2847.  
  2848.  
  2849.  
  2850.  
  2851.                                                                          63
  2852.  
  2853.  
  2854.  
  2855.  
  2856.  
  2857.           FONTGETINFO
  2858.  
  2859.             PROTOTYPE
  2860.  
  2861.             SUB FONTGETINFO (Width%, Height%)
  2862.  
  2863.             INPUT
  2864.  
  2865.             no input parameters
  2866.     WEND
  2867.             MOUSEEXIT
  2868.             VIDEOMODESET VMODE
  2869.             END
  2870.  
  2871.  
  2872.  
  2873.  
  2874.  
  2875.  
  2876.  
  2877.  
  2878.  
  2879.  
  2880.  
  2881.  
  2882.  
  2883.  
  2884.  
  2885.  
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.  
  2909.  
  2910.                                                                          86
  2911.  
  2912.  
  2913.  
  2914.  
  2915.  
  2916.           MOUSECURSORDEFAULT
  2917.  
  2918.             PROTOTYPE
  2919.  
  2920.             SUB MOUSECURSORDEFAULT ()
  2921.  
  2922.             INPUT
  2923.  
  2924.             no input parameters
  2925.  
  2926.             OUTPUT
  2927.  
  2928.             no value returned
  2929.  
  2930.             USAGE
  2931.  
  2932.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  2933.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  2934. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  2935. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  2936. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  2937. $╤
  2938. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  2939. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  2940. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  2941.       end;
  2942.     end;
  2943.   end;
  2944.   WaitToGo;
  2945. end; { UserLineStylePlay }
  2946.  
  2947.  
  2948. procedure SayGoodbye;
  2949. { Say goodbye and then exit the program }
  2950. var
  2951.   ViewInfo : ViewPortType;
  2952. begin
  2953.   MainWindow('');
  2954.   GetViewSettings(ViewInfo);
  2955.   SetTextStyle(TriplexFont, HorizDir, 4);
  2956.   SetTextJustify(CenterText, CenterText);
  2957.   with ViewInfo do
  2958.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  2959.   StatusLine('Press any key to quit...');
  2960.   repeat until KeyPressed;
  2961. end; { SayGoodbye }
  2962.  
  2963.  
  2964. PROCEDURE SelectMode;
  2965. VAR
  2966.     choice1,choice2     : CHAR;
  2967.    xsize,ysize            : WORD;
  2968. BEGIN
  2969.     (* Let's select a mode *)
  2970.     ClrScr;
  2971.     WriteLn('VESADEMO:');
  2972.     WriteLn('1. 256 colors');
  2973.     WriteLn('2. 32768 colors');
  2974.     WriteLn('3. 65536 colors');
  2975.     WriteLn('4. 16777216 colors');
  2976.     WriteLn('Q uit');
  2977.     WriteLn;
  2978.     Write('Your choice: ');
  2979.     REPEAT
  2980.         ReadLn(choice1);
  2981.       IF choice1 <> '1' THEN BEGIN
  2982.           WriteLn('Sorry !');
  2983.          WriteLn('This demo wasn''t written for more as 256 colors !');
  2984.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  2985.          WriteLn('Switching to 256 colors.');
  2986.          choice1 := '1';
  2987.       END;
  2988.     UNTIL choice1 IN ['1'..'4','q'];
  2989.     IF choice1 = 'q' THEN Halt;
  2990.  
  2991.     WriteLn;
  2992.     WriteLn;
  2993.     WriteLn('a. 320x200');
  2994.     WriteLn('b. 640x480');
  2995.     WriteLn('c. 800x600');
  2996.     WriteLn('d. 1024x768');
  2997.     WriteLn('e. 1280x1024');
  2998.     WriteLn('Q uit');
  2999.     WriteLn;
  3000.     Write('Your choice: ');
  3001.     REPEAT
  3002.         ReadLn(choice2);
  3003.     UNTIL choice2 IN ['a'..'e','q'];
  3004.     IF choice2 = 'q' THEN Halt;
  3005.  
  3006.     CASE choice2 OF
  3007.         'a' : BEGIN
  3008.             xsize := 320;
  3009.             ysize := 200;
  3010.         END;
  3011.         'b' : BEGIN
  3012.             xsize := 640;
  3013.             ysize := 480;
  3014.         END;
  3015.         'c' : BEGIN
  3016.             xsize := 800;
  3017.             ysize := 600;
  3018.         END;
  3019.         'd' : BEGIN
  3020.             xsize := 1024;
  3021.             ysize := 768;
  3022.         END;
  3023.         'e' : BEGIN
  3024.             xsize := 1280;
  3025.             ysize := 1024;
  3026.         END;
  3027.     END;
  3028.     CASE choice1 OF
  3029.         '1' : mode := FindVesaMode(xsize,ysize,8);
  3030.         '2' : mode := FindVesaMode(xsize,ysize,15);
  3031.         '3' : mode := FindVesaMode(xsize,ysize,16);
  3032.         '4' : mode := FindVesaMode(xsize,ysize,24);
  3033.     END;
  3034.     IF mode = 0 THEN BEGIN
  3035.         WriteLn('No such mode could be found !');
  3036.         WriteLn('Switching to to 320x200.');
  3037.         ReadKey;
  3038.         mode := V320x200x256;
  3039.     END;
  3040. END;
  3041.  
  3042. begin { program body }
  3043.   SelectMode;
  3044.   Initialize;
  3045.   ReportStatus;
  3046.  
  3047. {  AspectRatioPlay; }
  3048.   FillEllipsePlay;
  3049.   SectorPlay;
  3050.   WriteModePlay;
  3051.  
  3052.   ColorPlay;
  3053.   { PalettePlay only intended to work on these drivers: }
  3054.   if (GraphDriver = EGA) or
  3055.       (GraphDriver = EGA64) or
  3056.       (GraphDriver = VGA) then
  3057.      PalettePlay;
  3058.   PutPixelPlay;
  3059. {  PutImagePlay; }
  3060.   RandBarPlay;
  3061.   BarPlay;
  3062.   Bar3DPlay;
  3063.   ArcPlay;
  3064.   CirclePlay;
  3065.   PiePlay;
  3066.   LineToPlay;
  3067.   LineRelPlay;
  3068. {  LineStylePlay; }
  3069. {  UserLineStylePlay; }
  3070.   TextDump;
  3071.   TextPlay;
  3072.   CrtModePlay;
  3073.   FillStylePlay;
  3074.   FillPatternPlay;
  3075.   PolyPlay;
  3076.   SayGoodbye;
  3077. {  CloseGraph; }
  3078.   CloseVesa;
  3079. end.
  3080. ***************************************************
  3081.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  3082.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  3083. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  3084. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  3085.     Color := RandColor;
  3086.     SetColor(Color);
  3087.     SetFillStyle(Random(CloseDotFill)+1, Color);
  3088.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  3089.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  3090.   until KeyPressed;
  3091.   WaitToGo;
  3092. end; { RandBarPlay }
  3093.  
  3094. procedure ArcPlay;
  3095. { Draw random arcs on the screen }
  3096. var
  3097.   MaxRadius : word;
  3098.   EndAngle : word;
  3099.   ArcInfo : ArcCoordsType;
  3100. begin
  3101.   MainWindow('Arc / GetArcCoords demonstration');
  3102.   StatusLine('Esc aborts or press a key');
  3103.   MaxRadius := MaxY div 10;
  3104.   repeat
  3105.     SetColor(RandColor);
  3106.     EndAngle := Random(360);
  3107.     SetLineStyle(SolidLn, 0, NormWidth);
  3108.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  3109.     GetArcCoords(ArcInfo);
  3110.     with ArcInfo do
  3111.     begin
  3112.       Line(X, Y, XStart, YStart);
  3113.       Line(X, Y, Xend, Yend);
  3114.     end;
  3115.   until KeyPressed;
  3116.   WaitToGo;
  3117. end; { ArcPlay }
  3118.  
  3119. procedure PutPixelPlay;
  3120. { Demonstrate the PutPixel and GetPixel commands }
  3121. const
  3122.   Seed   = 1962; { A seed for the random number generator }
  3123.   NumPts = 2000; { The number of pixels plotted }
  3124.   Esc    = #27;
  3125. var
  3126.   I : word;
  3127.   X, Y, Color : word;
  3128.   XMax, YMax  : integer;
  3129.   ViewInfo    : ViewPortType;
  3130. begin
  3131.   MainWindow('PutPixel / GetPixel demonstration');
  3132.   StatusLine('Esc aborts or press a key...');
  3133.  
  3134.   GetViewSettings(ViewInfo);
  3135.   with ViewInfo do
  3136.   begin
  3137.     XMax := (x2-x1-1);
  3138.     YMax := (y2-y1-1);
  3139.   end;
  3140.  
  3141.   while not KeyPressed do
  3142.   begin
  3143.     { Plot random pixels }
  3144.     RandSeed := Seed;
  3145.     I := 0;
  3146.     while (not KeyPressed) and (I < NumPts) do
  3147.     begin
  3148.       Inc(I);
  3149.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  3150.     end;
  3151.  
  3152.     { Erase pixels }
  3153.     RandSeed := Seed;
  3154.     I := 0;
  3155.     while (not KeyPressed) and (I < NumPts) do
  3156.     begin
  3157.       Inc(I);
  3158.       X := Random(XMax)+1;
  3159.       Y := Random(YMax)+1;
  3160.       Color := GetPixel(X, Y);
  3161.         if Color = RandColor then
  3162.           PutPixel(X, Y, 0);
  3163.      end;
  3164.   end;
  3165.   WaitToGo;
  3166. end; { PutPixelPlay }
  3167.  
  3168. procedure PutImagePlay;
  3169. { Demonstrate the GetImage and PutImage commands }
  3170.  
  3171. const
  3172.   r  = 20;
  3173.   StartX = 100;
  3174.   StartY = 50;
  3175.  
  3176. var
  3177.   CurPort : ViewPortType;
  3178.  
  3179. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  3180. var
  3181.   Step : integer;
  3182. begin
  3183.   Step := Random(2*r);
  3184.   if Odd(Step) then
  3185.     Step := -Step;
  3186.   X := X + Step;
  3187.   Step := Random(r);
  3188.   if Odd(Step) then
  3189.     Step := -Step;
  3190.   Y := Y + Step;
  3191.  
  3192.   { Make saucer bounce off viewport walls }
  3193.   with CurPort do
  3194.   begin
  3195.     if (x1 + X + Width - 1 > x2) then
  3196.       X := x2-x1 - Width + 1
  3197.     else
  3198.       if (X < 0) then
  3199.         X := 0;
  3200.     if (y1 + Y + Height - 1 > y2) then
  3201.       Y := y2-y1 - Height + 1
  3202.     else
  3203.       if (Y < 0) then
  3204.         Y := 0;
  3205.   end;
  3206. end; { MoveSaucer }
  3207.  
  3208. var
  3209.   Pausetime : word;
  3210.   Saucer    : pointer;
  3211.   X, Y      : integer;
  3212.   ulx, uly  : word;
  3213.   lrx, lry  : word;
  3214.   Size      : word;
  3215.   I         : word;
  3216. begin
  3217.   ClearDevice;
  3218.   FullPort;
  3219.  
  3220.   { PaintScreen }
  3221.   ClearDevice;
  3222.   MainWindow('GetImage / PutImage Demonstration');
  3223.   StatusLine('Esc aborts or press a key...');
  3224.   GetViewSettings(CurPort);
  3225.  
  3226.   { DrawSaucer }
  3227.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  3228.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  3229.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  3230.   Circle(StartX+10, StartY-12, 2);
  3231.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  3232.   Circle(StartX-10, StartY-12, 2);
  3233.   SetFillStyle(SolidFill, MaxColor);
  3234.   FloodFill(StartX+1, StartY+4, GetColor);
  3235.  
  3236.   { ReadSaucerImage }
  3237.   ulx := StartX-(r+1);
  3238.   uly := StartY-14;
  3239.   lrx := StartX+(r+1);
  3240.   lry := StartY+(r div 3)+3;
  3241.  
  3242.   Size := ImageSize(ulx, uly, lrx, lry);
  3243.   GetMem(Saucer, Size);
  3244.   GetImage(ulx, uly, lrx, lry, Saucer^);
  3245. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  3246.  
  3247.   { Plot some "stars" }
  3248.   for I := 1 to 1000 do
  3249.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  3250.   X := MaxX div 2;
  3251.   Y := MaxY div 2;
  3252.   PauseTime := 70;
  3253.  
  3254.   { Move the saucer around }
  3255.   repeat
  3256. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  3257.      Delay(PauseTime);
  3258. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  3259.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  3260.   until KeyPressed;
  3261.   FreeMem(Saucer, size);
  3262.   WaitToGo;
  3263. end; { PutImagePlay }
  3264.  
  3265. procedure PolyPlay;
  3266. { Draw random polygons with random fill styles on the screen }
  3267. const
  3268.   MaxPts = 5;
  3269. type
  3270.   PolygonType = array[1..MaxPts] of PointType;
  3271. var
  3272.   Poly : PolygonType;
  3273.   I, Color : word;
  3274. begin
  3275.   MainWindow('FillPoly demonstration');
  3276.   StatusLine('Esc aborts or press a key...');
  3277.   repeat
  3278.     Color := RandColor;
  3279.     SetFillStyle(Random(11)+1, Color);
  3280.     SetColor(Color);
  3281.     for I := 1 to MaxPts do
  3282.       with Poly[I] do
  3283.       begin
  3284.         X := Random(MaxX);
  3285.         Y := Random(MaxY);
  3286.       end;
  3287.     FillPoly(MaxPts, Poly);
  3288.   until KeyPressed;
  3289.   WaitToGo;
  3290. end; { PolyPlay }
  3291.  
  3292. procedure FillStylePlay;
  3293. { Display all of the predefined fill styles available }
  3294. var
  3295.   Style    : word;
  3296.   Width    : word;
  3297.   Height   : word;
  3298.   X, Y     : word;
  3299.   I, J     : word;
  3300.   ViewInfo : ViewPortType;
  3301.  
  3302. procedure DrawBox(X, Y : word);
  3303. begin
  3304.   SetFillStyle(Style, MaxColor);
  3305.   with ViewInfo do
  3306.     Bar(X, Y, X+Width, Y+Height);
  3307.   Rectangle(X, Y, X+Width, Y+Height);
  3308.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  3309.   Inc(Style);
  3310. end; { DrawBox }
  3311.  
  3312. begin
  3313.   MainWindow('Pre-defined fill styles');
  3314.   GetViewSettings(ViewInfo);
  3315.   with ViewInfo do
  3316.   begin
  3317.     Width := 2 * ((x2+1) div 13);
  3318.     Height := 2 * ((y2-10) div 10);
  3319.   end;
  3320.   X := Width div 2;
  3321.   Y := Height div 2;
  3322.   Style := 0;
  3323.   for J := 1 to 3 do
  3324.   begin
  3325.     for I := 1 to 4 do
  3326.     begin
  3327.       DrawBox(X, Y);
  3328.       Inc(X, (Width div 2) * 3);
  3329.     end;
  3330.     X := Width div 2;
  3331.     Inc(Y, (Height div 2) * 3);
  3332.   end;
  3333.   SetTextJustify(LeftText, TopText);
  3334.   WaitToGo;
  3335. end; { FillStylePlay }
  3336.  
  3337. procedure FillPatternPlay;
  3338. { Display some user defined fill patterns }
  3339. const
  3340.   Patterns : array[0..11] of FillPatternType = (
  3341.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  3342.             OldColor which has a path of pixels of OldColor or NewColor
  3343.             with sides touching back to the seed point, (XSeed, YSeed).
  3344.             Therefore, only pixels of OldColor are modified and no other
  3345.             information is changed.
  3346.  
  3347.             SEE ALSO
  3348.  
  3349.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  3350.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  3351.             SETVIEW
  3352.  
  3353.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  3354.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  3355.             IF WHICHVGA = 0 THEN STOP
  3356.             DUMMY=RES640
  3357.             SETVIEW 100, 100, 539, 379
  3358.             FILLVIEW 10
  3359.             WHILE INKEY$ = ""
  3360.             WEND
  3361.             VIDEOMODESET VMODE
  3362.             END
  3363.  
  3364.  
  3365.  
  3366.  
  3367.  
  3368.  
  3369.  
  3370.  
  3371.  
  3372.  
  3373.  
  3374.  
  3375.  
  3376.  
  3377.  
  3378.  
  3379.                                                                          63
  3380.  
  3381.  
  3382.  
  3383.  
  3384.  
  3385.           FONTGETINFO
  3386.  
  3387.             PROTOTYPE
  3388.  
  3389.             SUB FONTGETINFO (Width%, Height%)
  3390.  
  3391.             INPUT
  3392.  
  3393.             no input parameters
  3394.     WEND
  3395.             MOUSEEXIT
  3396.             VIDEOMODESET VMODE
  3397.             END
  3398.  
  3399.  
  3400.  
  3401.  
  3402.  
  3403.  
  3404.  
  3405.  
  3406.  
  3407.  
  3408.  
  3409.  
  3410.  
  3411.  
  3412.  
  3413.  
  3414.  
  3415.  
  3416.  
  3417.  
  3418.  
  3419.  
  3420.  
  3421.  
  3422.  
  3423.  
  3424.  
  3425.  
  3426.  
  3427.  
  3428.  
  3429.  
  3430.  
  3431.  
  3432.  
  3433.  
  3434.  
  3435.  
  3436.  
  3437.  
  3438.                                                                          86
  3439.  
  3440.  
  3441.  
  3442.  
  3443.  
  3444.           MOUSECURSORDEFAULT
  3445.  
  3446.             PROTOTYPE
  3447.  
  3448.             SUB MOUSECURSORDEFAULT ()
  3449.  
  3450.             INPUT
  3451.  
  3452.             no input parameters
  3453.  
  3454.             OUTPUT
  3455.  
  3456.             no value returned
  3457.  
  3458.             USAGE
  3459.  
  3460.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  3461.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  3462. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  3463. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  3464. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  3465. $╤
  3466. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  3467. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  3468. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  3469.       end;
  3470.     end;
  3471.   end;
  3472.   WaitToGo;
  3473. end; { UserLineStylePlay }
  3474.  
  3475.  
  3476. procedure SayGoodbye;
  3477. { Say goodbye and then exit the program }
  3478. var
  3479.   ViewInfo : ViewPortType;
  3480. begin
  3481.   MainWindow('');
  3482.   GetViewSettings(ViewInfo);
  3483.   SetTextStyle(TriplexFont, HorizDir, 4);
  3484.   SetTextJustify(CenterText, CenterText);
  3485.   with ViewInfo do
  3486.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  3487.   StatusLine('Press any key to quit...');
  3488.   repeat until KeyPressed;
  3489. end; { SayGoodbye }
  3490.  
  3491.  
  3492. PROCEDURE SelectMode;
  3493. VAR
  3494.     choice1,choice2     : CHAR;
  3495.    xsize,ysize            : WORD;
  3496. BEGIN
  3497.     (* Let's select a mode *)
  3498.     ClrScr;
  3499.     WriteLn('VESADEMO:');
  3500.     WriteLn('1. 256 colors');
  3501.     WriteLn('2. 32768 colors');
  3502.     WriteLn('3. 65536 colors');
  3503.     WriteLn('4. 16777216 colors');
  3504.     WriteLn('Q uit');
  3505.     WriteLn;
  3506.     Write('Your choice: ');
  3507.     REPEAT
  3508.         ReadLn(choice1);
  3509.       IF choice1 <> '1' THEN BEGIN
  3510.           WriteLn('Sorry !');
  3511.          WriteLn('This demo wasn''t written for more as 256 colors !');
  3512.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  3513.          WriteLn('Switching to 256 colors.');
  3514.          choice1 := '1';
  3515.       END;
  3516.     UNTIL choice1 IN ['1'..'4','q'];
  3517.     IF choice1 = 'q' THEN Halt;
  3518.  
  3519.     WriteLn;
  3520.     WriteLn;
  3521.     WriteLn('a. 320x200');
  3522.     WriteLn('b. 640x480');
  3523.     WriteLn('c. 800x600');
  3524.     WriteLn('d. 1024x768');
  3525.     WriteLn('e. 1280x1024');
  3526.     WriteLn('Q uit');
  3527.     WriteLn;
  3528.     Write('Your choice: ');
  3529.     REPEAT
  3530.         ReadLn(choice2);
  3531.     UNTIL choice2 IN ['a'..'e','q'];
  3532.     IF choice2 = 'q' THEN Halt;
  3533.  
  3534.     CASE choice2 OF
  3535.         'a' : BEGIN
  3536.             xsize := 320;
  3537.             ysize := 200;
  3538.         END;
  3539.         'b' : BEGIN
  3540.             xsize := 640;
  3541.             ysize := 480;
  3542.         END;
  3543.         'c' : BEGIN
  3544.             xsize := 800;
  3545.             ysize := 600;
  3546.         END;
  3547.         'd' : BEGIN
  3548.             xsize := 1024;
  3549.             ysize := 768;
  3550.         END;
  3551.         'e' : BEGIN
  3552.             xsize := 1280;
  3553.             ysize := 1024;
  3554.         END;
  3555.     END;
  3556.     CASE choice1 OF
  3557.         '1' : mode := FindVesaMode(xsize,ysize,8);
  3558.         '2' : mode := FindVesaMode(xsize,ysize,15);
  3559.         '3' : mode := FindVesaMode(xsize,ysize,16);
  3560.         '4' : mode := FindVesaMode(xsize,ysize,24);
  3561.     END;
  3562.     IF mode = 0 THEN BEGIN
  3563.         WriteLn('No such mode could be found !');
  3564.         WriteLn('Switching to to 320x200.');
  3565.         ReadKey;
  3566.         mode := V320x200x256;
  3567.     END;
  3568. END;
  3569.  
  3570. begin { program body }
  3571.   SelectMode;
  3572.   Initialize;
  3573.   ReportStatus;
  3574.  
  3575. {  AspectRatioPlay; }
  3576.   FillEllipsePlay;
  3577.   SectorPlay;
  3578.   WriteModePlay;
  3579.  
  3580.   ColorPlay;
  3581.   { PalettePlay only intended to work on these drivers: }
  3582.   if (GraphDriver = EGA) or
  3583.       (GraphDriver = EGA64) or
  3584.       (GraphDriver = VGA) then
  3585.      PalettePlay;
  3586.   PutPixelPlay;
  3587. {  PutImagePlay; }
  3588.   RandBarPlay;
  3589.   BarPlay;
  3590.   Bar3DPlay;
  3591.   ArcPlay;
  3592.   CirclePlay;
  3593.   PiePlay;
  3594.   LineToPlay;
  3595.   LineRelPlay;
  3596. {  LineStylePlay; }
  3597. {  UserLineStylePlay; }
  3598.   TextDump;
  3599.   TextPlay;
  3600.   CrtModePlay;
  3601.   FillStylePlay;
  3602.   FillPatternPlay;
  3603.   PolyPlay;
  3604.   SayGoodbye;
  3605. {  CloseGraph; }
  3606.   CloseVesa;
  3607. end.
  3608. ***************************************************
  3609.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  3610.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  3611. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  3612. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  3613.     Color := RandColor;
  3614.     SetColor(Color);
  3615.     SetFillStyle(Random(CloseDotFill)+1, Color);
  3616.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  3617.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  3618.   until KeyPressed;
  3619.   WaitToGo;
  3620. end; { RandBarPlay }
  3621.  
  3622. procedure ArcPlay;
  3623. { Draw random arcs on the screen }
  3624. var
  3625.   MaxRadius : word;
  3626.   EndAngle : word;
  3627.   ArcInfo : ArcCoordsType;
  3628. begin
  3629.   MainWindow('Arc / GetArcCoords demonstration');
  3630.   StatusLine('Esc aborts or press a key');
  3631.   MaxRadius := MaxY div 10;
  3632.   repeat
  3633.     SetColor(RandColor);
  3634.     EndAngle := Random(360);
  3635.     SetLineStyle(SolidLn, 0, NormWidth);
  3636.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  3637.     GetArcCoords(ArcInfo);
  3638.     with ArcInfo do
  3639.     begin
  3640.       Line(X, Y, XStart, YStart);
  3641.       Line(X, Y, Xend, Yend);
  3642.     end;
  3643.   until KeyPressed;
  3644.   WaitToGo;
  3645. end; { ArcPlay }
  3646.  
  3647. procedure PutPixelPlay;
  3648. { Demonstrate the PutPixel and GetPixel commands }
  3649. const
  3650.   Seed   = 1962; { A seed for the random number generator }
  3651.   NumPts = 2000; { The number of pixels plotted }
  3652.   Esc    = #27;
  3653. var
  3654.   I : word;
  3655.   X, Y, Color : word;
  3656.   XMax, YMax  : integer;
  3657.   ViewInfo    : ViewPortType;
  3658. begin
  3659.   MainWindow('PutPixel / GetPixel demonstration');
  3660.   StatusLine('Esc aborts or press a key...');
  3661.  
  3662.   GetViewSettings(ViewInfo);
  3663.   with ViewInfo do
  3664.   begin
  3665.     XMax := (x2-x1-1);
  3666.     YMax := (y2-y1-1);
  3667.   end;
  3668.  
  3669.   while not KeyPressed do
  3670.   begin
  3671.     { Plot random pixels }
  3672.     RandSeed := Seed;
  3673.     I := 0;
  3674.     while (not KeyPressed) and (I < NumPts) do
  3675.     begin
  3676.       Inc(I);
  3677.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  3678.     end;
  3679.  
  3680.     { Erase pixels }
  3681.     RandSeed := Seed;
  3682.     I := 0;
  3683.     while (not KeyPressed) and (I < NumPts) do
  3684.     begin
  3685.       Inc(I);
  3686.       X := Random(XMax)+1;
  3687.       Y := Random(YMax)+1;
  3688.       Color := GetPixel(X, Y);
  3689.         if Color = RandColor then
  3690.           PutPixel(X, Y, 0);
  3691.      end;
  3692.   end;
  3693.   WaitToGo;
  3694. end; { PutPixelPlay }
  3695.  
  3696. procedure PutImagePlay;
  3697. { Demonstrate the GetImage and PutImage commands }
  3698.  
  3699. const
  3700.   r  = 20;
  3701.   StartX = 100;
  3702.   StartY = 50;
  3703.  
  3704. var
  3705.   CurPort : ViewPortType;
  3706.  
  3707. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  3708. var
  3709.   Step : integer;
  3710. begin
  3711.   Step := Random(2*r);
  3712.   if Odd(Step) then
  3713.     Step := -Step;
  3714.   X := X + Step;
  3715.   Step := Random(r);
  3716.   if Odd(Step) then
  3717.     Step := -Step;
  3718.   Y := Y + Step;
  3719.  
  3720.   { Make saucer bounce off viewport walls }
  3721.   with CurPort do
  3722.   begin
  3723.     if (x1 + X + Width - 1 > x2) then
  3724.       X := x2-x1 - Width + 1
  3725.     else
  3726.       if (X < 0) then
  3727.         X := 0;
  3728.     if (y1 + Y + Height - 1 > y2) then
  3729.       Y := y2-y1 - Height + 1
  3730.     else
  3731.       if (Y < 0) then
  3732.         Y := 0;
  3733.   end;
  3734. end; { MoveSaucer }
  3735.  
  3736. var
  3737.   Pausetime : word;
  3738.   Saucer    : pointer;
  3739.   X, Y      : integer;
  3740.   ulx, uly  : word;
  3741.   lrx, lry  : word;
  3742.   Size      : word;
  3743.   I         : word;
  3744. begin
  3745.   ClearDevice;
  3746.   FullPort;
  3747.  
  3748.   { PaintScreen }
  3749.   ClearDevice;
  3750.   MainWindow('GetImage / PutImage Demonstration');
  3751.   StatusLine('Esc aborts or press a key...');
  3752.   GetViewSettings(CurPort);
  3753.  
  3754.   { DrawSaucer }
  3755.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  3756.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  3757.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  3758.   Circle(StartX+10, StartY-12, 2);
  3759.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  3760.   Circle(StartX-10, StartY-12, 2);
  3761.   SetFillStyle(SolidFill, MaxColor);
  3762.   FloodFill(StartX+1, StartY+4, GetColor);
  3763.  
  3764.   { ReadSaucerImage }
  3765.   ulx := StartX-(r+1);
  3766.   uly := StartY-14;
  3767.   lrx := StartX+(r+1);
  3768.   lry := StartY+(r div 3)+3;
  3769.  
  3770.   Size := ImageSize(ulx, uly, lrx, lry);
  3771.   GetMem(Saucer, Size);
  3772.   GetImage(ulx, uly, lrx, lry, Saucer^);
  3773. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  3774.  
  3775.   { Plot some "stars" }
  3776.   for I := 1 to 1000 do
  3777.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  3778.   X := MaxX div 2;
  3779.   Y := MaxY div 2;
  3780.   PauseTime := 70;
  3781.  
  3782.   { Move the saucer around }
  3783.   repeat
  3784. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  3785.      Delay(PauseTime);
  3786. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  3787.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  3788.   until KeyPressed;
  3789.   FreeMem(Saucer, size);
  3790.   WaitToGo;
  3791. end; { PutImagePlay }
  3792.  
  3793. procedure PolyPlay;
  3794. { Draw random polygons with random fill styles on the screen }
  3795. const
  3796.   MaxPts = 5;
  3797. type
  3798.   PolygonType = array[1..MaxPts] of PointType;
  3799. var
  3800.   Poly : PolygonType;
  3801.   I, Color : word;
  3802. begin
  3803.   MainWindow('FillPoly demonstration');
  3804.   StatusLine('Esc aborts or press a key...');
  3805.   repeat
  3806.     Color := RandColor;
  3807.     SetFillStyle(Random(11)+1, Color);
  3808.     SetColor(Color);
  3809.     for I := 1 to MaxPts do
  3810.       with Poly[I] do
  3811.       begin
  3812.         X := Random(MaxX);
  3813.         Y := Random(MaxY);
  3814.       end;
  3815.     FillPoly(MaxPts, Poly);
  3816.   until KeyPressed;
  3817.   WaitToGo;
  3818. end; { PolyPlay }
  3819.  
  3820. procedure FillStylePlay;
  3821. { Display all of the predefined fill styles available }
  3822. var
  3823.   Style    : word;
  3824.   Width    : word;
  3825.   Height   : word;
  3826.   X, Y     : word;
  3827.   I, J     : word;
  3828.   ViewInfo : ViewPortType;
  3829.  
  3830. procedure DrawBox(X, Y : word);
  3831. begin
  3832.   SetFillStyle(Style, MaxColor);
  3833.   with ViewInfo do
  3834.     Bar(X, Y, X+Width, Y+Height);
  3835.   Rectangle(X, Y, X+Width, Y+Height);
  3836.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  3837.   Inc(Style);
  3838. end; { DrawBox }
  3839.  
  3840. begin
  3841.   MainWindow('Pre-defined fill styles');
  3842.   GetViewSettings(ViewInfo);
  3843.   with ViewInfo do
  3844.   begin
  3845.     Width := 2 * ((x2+1) div 13);
  3846.     Height := 2 * ((y2-10) div 10);
  3847.   end;
  3848.   X := Width div 2;
  3849.   Y := Height div 2;
  3850.   Style := 0;
  3851.   for J := 1 to 3 do
  3852.   begin
  3853.     for I := 1 to 4 do
  3854.     begin
  3855.       DrawBox(X, Y);
  3856.       Inc(X, (Width div 2) * 3);
  3857.     end;
  3858.     X := Width div 2;
  3859.     Inc(Y, (Height div 2) * 3);
  3860.   end;
  3861.   SetTextJustify(LeftText, TopText);
  3862.   WaitToGo;
  3863. end; { FillStylePlay }
  3864.  
  3865. procedure FillPatternPlay;
  3866. { Display some user defined fill patterns }
  3867. const
  3868.   Patterns : array[0..11] of FillPatternType = (
  3869.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  3870.             OldColor which has a path of pixels of OldColor or NewColor
  3871.             with sides touching back to the seed point, (XSeed, YSeed).
  3872.             Therefore, only pixels of OldColor are modified and no other
  3873.             information is changed.
  3874.  
  3875.             SEE ALSO
  3876.  
  3877.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  3878.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  3879.             SETVIEW
  3880.  
  3881.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  3882.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  3883.             IF WHICHVGA = 0 THEN STOP
  3884.             DUMMY=RES640
  3885.             SETVIEW 100, 100, 539, 379
  3886.             FILLVIEW 10
  3887.             WHILE INKEY$ = ""
  3888.             WEND
  3889.             VIDEOMODESET VMODE
  3890.             END
  3891.  
  3892.  
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898.  
  3899.  
  3900.  
  3901.  
  3902.  
  3903.  
  3904.  
  3905.  
  3906.  
  3907.                                                                          63
  3908.  
  3909.  
  3910.  
  3911.  
  3912.  
  3913.           FONTGETINFO
  3914.  
  3915.             PROTOTYPE
  3916.  
  3917.             SUB FONTGETINFO (Width%, Height%)
  3918.  
  3919.             INPUT
  3920.  
  3921.             no input parameters
  3922.     WEND
  3923.             MOUSEEXIT
  3924.             VIDEOMODESET VMODE
  3925.             END
  3926.  
  3927.  
  3928.  
  3929.  
  3930.  
  3931.  
  3932.  
  3933.  
  3934.  
  3935.  
  3936.  
  3937.  
  3938.  
  3939.  
  3940.  
  3941.  
  3942.  
  3943.  
  3944.  
  3945.  
  3946.  
  3947.  
  3948.  
  3949.  
  3950.  
  3951.  
  3952.  
  3953.  
  3954.  
  3955.  
  3956.  
  3957.  
  3958.  
  3959.  
  3960.  
  3961.  
  3962.  
  3963.  
  3964.  
  3965.  
  3966.                                                                          86
  3967.  
  3968.  
  3969.  
  3970.  
  3971.  
  3972.           MOUSECURSORDEFAULT
  3973.  
  3974.             PROTOTYPE
  3975.  
  3976.             SUB MOUSECURSORDEFAULT ()
  3977.  
  3978.             INPUT
  3979.  
  3980.             no input parameters
  3981.  
  3982.             OUTPUT
  3983.  
  3984.             no value returned
  3985.  
  3986.             USAGE
  3987.  
  3988.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  3989.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  3990. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  3991. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  3992. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  3993. $╤
  3994. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  3995. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  3996. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  3997.       end;
  3998.     end;
  3999.   end;
  4000.   WaitToGo;
  4001. end; { UserLineStylePlay }
  4002.  
  4003.  
  4004. procedure SayGoodbye;
  4005. { Say goodbye and then exit the program }
  4006. var
  4007.   ViewInfo : ViewPortType;
  4008. begin
  4009.   MainWindow('');
  4010.   GetViewSettings(ViewInfo);
  4011.   SetTextStyle(TriplexFont, HorizDir, 4);
  4012.   SetTextJustify(CenterText, CenterText);
  4013.   with ViewInfo do
  4014.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  4015.   StatusLine('Press any key to quit...');
  4016.   repeat until KeyPressed;
  4017. end; { SayGoodbye }
  4018.  
  4019.  
  4020. PROCEDURE SelectMode;
  4021. VAR
  4022.     choice1,choice2     : CHAR;
  4023.    xsize,ysize            : WORD;
  4024. BEGIN
  4025.     (* Let's select a mode *)
  4026.     ClrScr;
  4027.     WriteLn('VESADEMO:');
  4028.     WriteLn('1. 256 colors');
  4029.     WriteLn('2. 32768 colors');
  4030.     WriteLn('3. 65536 colors');
  4031.     WriteLn('4. 16777216 colors');
  4032.     WriteLn('Q uit');
  4033.     WriteLn;
  4034.     Write('Your choice: ');
  4035.     REPEAT
  4036.         ReadLn(choice1);
  4037.       IF choice1 <> '1' THEN BEGIN
  4038.           WriteLn('Sorry !');
  4039.          WriteLn('This demo wasn''t written for more as 256 colors !');
  4040.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  4041.          WriteLn('Switching to 256 colors.');
  4042.          choice1 := '1';
  4043.       END;
  4044.     UNTIL choice1 IN ['1'..'4','q'];
  4045.     IF choice1 = 'q' THEN Halt;
  4046.  
  4047.     WriteLn;
  4048.     WriteLn;
  4049.     WriteLn('a. 320x200');
  4050.     WriteLn('b. 640x480');
  4051.     WriteLn('c. 800x600');
  4052.     WriteLn('d. 1024x768');
  4053.     WriteLn('e. 1280x1024');
  4054.     WriteLn('Q uit');
  4055.     WriteLn;
  4056.     Write('Your choice: ');
  4057.     REPEAT
  4058.         ReadLn(choice2);
  4059.     UNTIL choice2 IN ['a'..'e','q'];
  4060.     IF choice2 = 'q' THEN Halt;
  4061.  
  4062.     CASE choice2 OF
  4063.         'a' : BEGIN
  4064.             xsize := 320;
  4065.             ysize := 200;
  4066.         END;
  4067.         'b' : BEGIN
  4068.             xsize := 640;
  4069.             ysize := 480;
  4070.         END;
  4071.         'c' : BEGIN
  4072.             xsize := 800;
  4073.             ysize := 600;
  4074.         END;
  4075.         'd' : BEGIN
  4076.             xsize := 1024;
  4077.             ysize := 768;
  4078.         END;
  4079.         'e' : BEGIN
  4080.             xsize := 1280;
  4081.             ysize := 1024;
  4082.         END;
  4083.     END;
  4084.     CASE choice1 OF
  4085.         '1' : mode := FindVesaMode(xsize,ysize,8);
  4086.         '2' : mode := FindVesaMode(xsize,ysize,15);
  4087.         '3' : mode := FindVesaMode(xsize,ysize,16);
  4088.         '4' : mode := FindVesaMode(xsize,ysize,24);
  4089.     END;
  4090.     IF mode = 0 THEN BEGIN
  4091.         WriteLn('No such mode could be found !');
  4092.         WriteLn('Switching to to 320x200.');
  4093.         ReadKey;
  4094.         mode := V320x200x256;
  4095.     END;
  4096. END;
  4097.  
  4098. begin { program body }
  4099.   SelectMode;
  4100.   Initialize;
  4101.   ReportStatus;
  4102.  
  4103. {  AspectRatioPlay; }
  4104.   FillEllipsePlay;
  4105.   SectorPlay;
  4106.   WriteModePlay;
  4107.  
  4108.   ColorPlay;
  4109.   { PalettePlay only intended to work on these drivers: }
  4110.   if (GraphDriver = EGA) or
  4111.       (GraphDriver = EGA64) or
  4112.       (GraphDriver = VGA) then
  4113.      PalettePlay;
  4114.   PutPixelPlay;
  4115. {  PutImagePlay; }
  4116.   RandBarPlay;
  4117.   BarPlay;
  4118.   Bar3DPlay;
  4119.   ArcPlay;
  4120.   CirclePlay;
  4121.   PiePlay;
  4122.   LineToPlay;
  4123.   LineRelPlay;
  4124. {  LineStylePlay; }
  4125. {  UserLineStylePlay; }
  4126.   TextDump;
  4127.   TextPlay;
  4128.   CrtModePlay;
  4129.   FillStylePlay;
  4130.   FillPatternPlay;
  4131.   PolyPlay;
  4132.   SayGoodbye;
  4133. {  CloseGraph; }
  4134.   CloseVesa;
  4135. end.
  4136. ***************************************************
  4137.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  4138.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  4139. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  4140. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  4141.     Color := RandColor;
  4142.     SetColor(Color);
  4143.     SetFillStyle(Random(CloseDotFill)+1, Color);
  4144.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  4145.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  4146.   until KeyPressed;
  4147.   WaitToGo;
  4148. end; { RandBarPlay }
  4149.  
  4150. procedure ArcPlay;
  4151. { Draw random arcs on the screen }
  4152. var
  4153.   MaxRadius : word;
  4154.   EndAngle : word;
  4155.   ArcInfo : ArcCoordsType;
  4156. begin
  4157.   MainWindow('Arc / GetArcCoords demonstration');
  4158.   StatusLine('Esc aborts or press a key');
  4159.   MaxRadius := MaxY div 10;
  4160.   repeat
  4161.     SetColor(RandColor);
  4162.     EndAngle := Random(360);
  4163.     SetLineStyle(SolidLn, 0, NormWidth);
  4164.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  4165.     GetArcCoords(ArcInfo);
  4166.     with ArcInfo do
  4167.     begin
  4168.       Line(X, Y, XStart, YStart);
  4169.       Line(X, Y, Xend, Yend);
  4170.     end;
  4171.   until KeyPressed;
  4172.   WaitToGo;
  4173. end; { ArcPlay }
  4174.  
  4175. procedure PutPixelPlay;
  4176. { Demonstrate the PutPixel and GetPixel commands }
  4177. const
  4178.   Seed   = 1962; { A seed for the random number generator }
  4179.   NumPts = 2000; { The number of pixels plotted }
  4180.   Esc    = #27;
  4181. var
  4182.   I : word;
  4183.   X, Y, Color : word;
  4184.   XMax, YMax  : integer;
  4185.   ViewInfo    : ViewPortType;
  4186. begin
  4187.   MainWindow('PutPixel / GetPixel demonstration');
  4188.   StatusLine('Esc aborts or press a key...');
  4189.  
  4190.   GetViewSettings(ViewInfo);
  4191.   with ViewInfo do
  4192.   begin
  4193.     XMax := (x2-x1-1);
  4194.     YMax := (y2-y1-1);
  4195.   end;
  4196.  
  4197.   while not KeyPressed do
  4198.   begin
  4199.     { Plot random pixels }
  4200.     RandSeed := Seed;
  4201.     I := 0;
  4202.     while (not KeyPressed) and (I < NumPts) do
  4203.     begin
  4204.       Inc(I);
  4205.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  4206.     end;
  4207.  
  4208.     { Erase pixels }
  4209.     RandSeed := Seed;
  4210.     I := 0;
  4211.     while (not KeyPressed) and (I < NumPts) do
  4212.     begin
  4213.       Inc(I);
  4214.       X := Random(XMax)+1;
  4215.       Y := Random(YMax)+1;
  4216.       Color := GetPixel(X, Y);
  4217.         if Color = RandColor then
  4218.           PutPixel(X, Y, 0);
  4219.      end;
  4220.   end;
  4221.   WaitToGo;
  4222. end; { PutPixelPlay }
  4223.  
  4224. procedure PutImagePlay;
  4225. { Demonstrate the GetImage and PutImage commands }
  4226.  
  4227. const
  4228.   r  = 20;
  4229.   StartX = 100;
  4230.   StartY = 50;
  4231.  
  4232. var
  4233.   CurPort : ViewPortType;
  4234.  
  4235. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  4236. var
  4237.   Step : integer;
  4238. begin
  4239.   Step := Random(2*r);
  4240.   if Odd(Step) then
  4241.     Step := -Step;
  4242.   X := X + Step;
  4243.   Step := Random(r);
  4244.   if Odd(Step) then
  4245.     Step := -Step;
  4246.   Y := Y + Step;
  4247.  
  4248.   { Make saucer bounce off viewport walls }
  4249.   with CurPort do
  4250.   begin
  4251.     if (x1 + X + Width - 1 > x2) then
  4252.       X := x2-x1 - Width + 1
  4253.     else
  4254.       if (X < 0) then
  4255.         X := 0;
  4256.     if (y1 + Y + Height - 1 > y2) then
  4257.       Y := y2-y1 - Height + 1
  4258.     else
  4259.       if (Y < 0) then
  4260.         Y := 0;
  4261.   end;
  4262. end; { MoveSaucer }
  4263.  
  4264. var
  4265.   Pausetime : word;
  4266.   Saucer    : pointer;
  4267.   X, Y      : integer;
  4268.   ulx, uly  : word;
  4269.   lrx, lry  : word;
  4270.   Size      : word;
  4271.   I         : word;
  4272. begin
  4273.   ClearDevice;
  4274.   FullPort;
  4275.  
  4276.   { PaintScreen }
  4277.   ClearDevice;
  4278.   MainWindow('GetImage / PutImage Demonstration');
  4279.   StatusLine('Esc aborts or press a key...');
  4280.   GetViewSettings(CurPort);
  4281.  
  4282.   { DrawSaucer }
  4283.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  4284.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  4285.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  4286.   Circle(StartX+10, StartY-12, 2);
  4287.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  4288.   Circle(StartX-10, StartY-12, 2);
  4289.   SetFillStyle(SolidFill, MaxColor);
  4290.   FloodFill(StartX+1, StartY+4, GetColor);
  4291.  
  4292.   { ReadSaucerImage }
  4293.   ulx := StartX-(r+1);
  4294.   uly := StartY-14;
  4295.   lrx := StartX+(r+1);
  4296.   lry := StartY+(r div 3)+3;
  4297.  
  4298.   Size := ImageSize(ulx, uly, lrx, lry);
  4299.   GetMem(Saucer, Size);
  4300.   GetImage(ulx, uly, lrx, lry, Saucer^);
  4301. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  4302.  
  4303.   { Plot some "stars" }
  4304.   for I := 1 to 1000 do
  4305.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  4306.   X := MaxX div 2;
  4307.   Y := MaxY div 2;
  4308.   PauseTime := 70;
  4309.  
  4310.   { Move the saucer around }
  4311.   repeat
  4312. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  4313.      Delay(PauseTime);
  4314. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  4315.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  4316.   until KeyPressed;
  4317.   FreeMem(Saucer, size);
  4318.   WaitToGo;
  4319. end; { PutImagePlay }
  4320.  
  4321. procedure PolyPlay;
  4322. { Draw random polygons with random fill styles on the screen }
  4323. const
  4324.   MaxPts = 5;
  4325. type
  4326.   PolygonType = array[1..MaxPts] of PointType;
  4327. var
  4328.   Poly : PolygonType;
  4329.   I, Color : word;
  4330. begin
  4331.   MainWindow('FillPoly demonstration');
  4332.   StatusLine('Esc aborts or press a key...');
  4333.   repeat
  4334.     Color := RandColor;
  4335.     SetFillStyle(Random(11)+1, Color);
  4336.     SetColor(Color);
  4337.     for I := 1 to MaxPts do
  4338.       with Poly[I] do
  4339.       begin
  4340.         X := Random(MaxX);
  4341.         Y := Random(MaxY);
  4342.       end;
  4343.     FillPoly(MaxPts, Poly);
  4344.   until KeyPressed;
  4345.   WaitToGo;
  4346. end; { PolyPlay }
  4347.  
  4348. procedure FillStylePlay;
  4349. { Display all of the predefined fill styles available }
  4350. var
  4351.   Style    : word;
  4352.   Width    : word;
  4353.   Height   : word;
  4354.   X, Y     : word;
  4355.   I, J     : word;
  4356.   ViewInfo : ViewPortType;
  4357.  
  4358. procedure DrawBox(X, Y : word);
  4359. begin
  4360.   SetFillStyle(Style, MaxColor);
  4361.   with ViewInfo do
  4362.     Bar(X, Y, X+Width, Y+Height);
  4363.   Rectangle(X, Y, X+Width, Y+Height);
  4364.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  4365.   Inc(Style);
  4366. end; { DrawBox }
  4367.  
  4368. begin
  4369.   MainWindow('Pre-defined fill styles');
  4370.   GetViewSettings(ViewInfo);
  4371.   with ViewInfo do
  4372.   begin
  4373.     Width := 2 * ((x2+1) div 13);
  4374.     Height := 2 * ((y2-10) div 10);
  4375.   end;
  4376.   X := Width div 2;
  4377.   Y := Height div 2;
  4378.   Style := 0;
  4379.   for J := 1 to 3 do
  4380.   begin
  4381.     for I := 1 to 4 do
  4382.     begin
  4383.       DrawBox(X, Y);
  4384.       Inc(X, (Width div 2) * 3);
  4385.     end;
  4386.     X := Width div 2;
  4387.     Inc(Y, (Height div 2) * 3);
  4388.   end;
  4389.   SetTextJustify(LeftText, TopText);
  4390.   WaitToGo;
  4391. end; { FillStylePlay }
  4392.  
  4393. procedure FillPatternPlay;
  4394. { Display some user defined fill patterns }
  4395. const
  4396.   Patterns : array[0..11] of FillPatternType = (
  4397.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  4398.             OldColor which has a path of pixels of OldColor or NewColor
  4399.             with sides touching back to the seed point, (XSeed, YSeed).
  4400.             Therefore, only pixels of OldColor are modified and no other
  4401.             information is changed.
  4402.  
  4403.             SEE ALSO
  4404.  
  4405.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  4406.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  4407.             SETVIEW
  4408.  
  4409.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  4410.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  4411.             IF WHICHVGA = 0 THEN STOP
  4412.             DUMMY=RES640
  4413.             SETVIEW 100, 100, 539, 379
  4414.             FILLVIEW 10
  4415.             WHILE INKEY$ = ""
  4416.             WEND
  4417.             VIDEOMODESET VMODE
  4418.             END
  4419.  
  4420.  
  4421.  
  4422.  
  4423.  
  4424.  
  4425.  
  4426.  
  4427.  
  4428.  
  4429.  
  4430.  
  4431.  
  4432.  
  4433.  
  4434.  
  4435.                                                                          63
  4436.  
  4437.  
  4438.  
  4439.  
  4440.  
  4441.           FONTGETINFO
  4442.  
  4443.             PROTOTYPE
  4444.  
  4445.             SUB FONTGETINFO (Width%, Height%)
  4446.  
  4447.             INPUT
  4448.  
  4449.             no input parameters
  4450.     WEND
  4451.             MOUSEEXIT
  4452.             VIDEOMODESET VMODE
  4453.             END
  4454.  
  4455.  
  4456.  
  4457.  
  4458.  
  4459.  
  4460.  
  4461.  
  4462.  
  4463.  
  4464.  
  4465.  
  4466.  
  4467.  
  4468.  
  4469.  
  4470.  
  4471.  
  4472.  
  4473.  
  4474.  
  4475.  
  4476.  
  4477.  
  4478.  
  4479.  
  4480.  
  4481.  
  4482.  
  4483.  
  4484.  
  4485.  
  4486.  
  4487.  
  4488.  
  4489.  
  4490.  
  4491.  
  4492.  
  4493.  
  4494.                                                                          86
  4495.  
  4496.  
  4497.  
  4498.  
  4499.  
  4500.           MOUSECURSORDEFAULT
  4501.  
  4502.             PROTOTYPE
  4503.  
  4504.             SUB MOUSECURSORDEFAULT ()
  4505.  
  4506.             INPUT
  4507.  
  4508.             no input parameters
  4509.  
  4510.             OUTPUT
  4511.  
  4512.             no value returned
  4513.  
  4514.             USAGE
  4515.  
  4516.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  4517.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  4518. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  4519. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  4520. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  4521. $╤
  4522. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  4523. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  4524. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  4525.       end;
  4526.     end;
  4527.   end;
  4528.   WaitToGo;
  4529. end; { UserLineStylePlay }
  4530.  
  4531.  
  4532. procedure SayGoodbye;
  4533. { Say goodbye and then exit the program }
  4534. var
  4535.   ViewInfo : ViewPortType;
  4536. begin
  4537.   MainWindow('');
  4538.   GetViewSettings(ViewInfo);
  4539.   SetTextStyle(TriplexFont, HorizDir, 4);
  4540.   SetTextJustify(CenterText, CenterText);
  4541.   with ViewInfo do
  4542.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  4543.   StatusLine('Press any key to quit...');
  4544.   repeat until KeyPressed;
  4545. end; { SayGoodbye }
  4546.  
  4547.  
  4548. PROCEDURE SelectMode;
  4549. VAR
  4550.     choice1,choice2     : CHAR;
  4551.    xsize,ysize            : WORD;
  4552. BEGIN
  4553.     (* Let's select a mode *)
  4554.     ClrScr;
  4555.     WriteLn('VESADEMO:');
  4556.     WriteLn('1. 256 colors');
  4557.     WriteLn('2. 32768 colors');
  4558.     WriteLn('3. 65536 colors');
  4559.     WriteLn('4. 16777216 colors');
  4560.     WriteLn('Q uit');
  4561.     WriteLn;
  4562.     Write('Your choice: ');
  4563.     REPEAT
  4564.         ReadLn(choice1);
  4565.       IF choice1 <> '1' THEN BEGIN
  4566.           WriteLn('Sorry !');
  4567.          WriteLn('This demo wasn''t written for more as 256 colors !');
  4568.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  4569.          WriteLn('Switching to 256 colors.');
  4570.          choice1 := '1';
  4571.       END;
  4572.     UNTIL choice1 IN ['1'..'4','q'];
  4573.     IF choice1 = 'q' THEN Halt;
  4574.  
  4575.     WriteLn;
  4576.     WriteLn;
  4577.     WriteLn('a. 320x200');
  4578.     WriteLn('b. 640x480');
  4579.     WriteLn('c. 800x600');
  4580.     WriteLn('d. 1024x768');
  4581.     WriteLn('e. 1280x1024');
  4582.     WriteLn('Q uit');
  4583.     WriteLn;
  4584.     Write('Your choice: ');
  4585.     REPEAT
  4586.         ReadLn(choice2);
  4587.     UNTIL choice2 IN ['a'..'e','q'];
  4588.     IF choice2 = 'q' THEN Halt;
  4589.  
  4590.     CASE choice2 OF
  4591.         'a' : BEGIN
  4592.             xsize := 320;
  4593.             ysize := 200;
  4594.         END;
  4595.         'b' : BEGIN
  4596.             xsize := 640;
  4597.             ysize := 480;
  4598.         END;
  4599.         'c' : BEGIN
  4600.             xsize := 800;
  4601.             ysize := 600;
  4602.         END;
  4603.         'd' : BEGIN
  4604.             xsize := 1024;
  4605.             ysize := 768;
  4606.         END;
  4607.         'e' : BEGIN
  4608.             xsize := 1280;
  4609.             ysize := 1024;
  4610.         END;
  4611.     END;
  4612.     CASE choice1 OF
  4613.         '1' : mode := FindVesaMode(xsize,ysize,8);
  4614.         '2' : mode := FindVesaMode(xsize,ysize,15);
  4615.         '3' : mode := FindVesaMode(xsize,ysize,16);
  4616.         '4' : mode := FindVesaMode(xsize,ysize,24);
  4617.     END;
  4618.     IF mode = 0 THEN BEGIN
  4619.         WriteLn('No such mode could be found !');
  4620.         WriteLn('Switching to to 320x200.');
  4621.         ReadKey;
  4622.         mode := V320x200x256;
  4623.     END;
  4624. END;
  4625.  
  4626. begin { program body }
  4627.   SelectMode;
  4628.   Initialize;
  4629.   ReportStatus;
  4630.  
  4631. {  AspectRatioPlay; }
  4632.   FillEllipsePlay;
  4633.   SectorPlay;
  4634.   WriteModePlay;
  4635.  
  4636.   ColorPlay;
  4637.   { PalettePlay only intended to work on these drivers: }
  4638.   if (GraphDriver = EGA) or
  4639.       (GraphDriver = EGA64) or
  4640.       (GraphDriver = VGA) then
  4641.      PalettePlay;
  4642.   PutPixelPlay;
  4643. {  PutImagePlay; }
  4644.   RandBarPlay;
  4645.   BarPlay;
  4646.   Bar3DPlay;
  4647.   ArcPlay;
  4648.   CirclePlay;
  4649.   PiePlay;
  4650.   LineToPlay;
  4651.   LineRelPlay;
  4652. {  LineStylePlay; }
  4653. {  UserLineStylePlay; }
  4654.   TextDump;
  4655.   TextPlay;
  4656.   CrtModePlay;
  4657.   FillStylePlay;
  4658.   FillPatternPlay;
  4659.   PolyPlay;
  4660.   SayGoodbye;
  4661. {  CloseGraph; }
  4662.   CloseVesa;
  4663. end.
  4664. ***************************************************
  4665.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  4666.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  4667. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  4668. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  4669.     Color := RandColor;
  4670.     SetColor(Color);
  4671.     SetFillStyle(Random(CloseDotFill)+1, Color);
  4672.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  4673.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  4674.   until KeyPressed;
  4675.   WaitToGo;
  4676. end; { RandBarPlay }
  4677.  
  4678. procedure ArcPlay;
  4679. { Draw random arcs on the screen }
  4680. var
  4681.   MaxRadius : word;
  4682.   EndAngle : word;
  4683.   ArcInfo : ArcCoordsType;
  4684. begin
  4685.   MainWindow('Arc / GetArcCoords demonstration');
  4686.   StatusLine('Esc aborts or press a key');
  4687.   MaxRadius := MaxY div 10;
  4688.   repeat
  4689.     SetColor(RandColor);
  4690.     EndAngle := Random(360);
  4691.     SetLineStyle(SolidLn, 0, NormWidth);
  4692.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  4693.     GetArcCoords(ArcInfo);
  4694.     with ArcInfo do
  4695.     begin
  4696.       Line(X, Y, XStart, YStart);
  4697.       Line(X, Y, Xend, Yend);
  4698.     end;
  4699.   until KeyPressed;
  4700.   WaitToGo;
  4701. end; { ArcPlay }
  4702.  
  4703. procedure PutPixelPlay;
  4704. { Demonstrate the PutPixel and GetPixel commands }
  4705. const
  4706.   Seed   = 1962; { A seed for the random number generator }
  4707.   NumPts = 2000; { The number of pixels plotted }
  4708.   Esc    = #27;
  4709. var
  4710.   I : word;
  4711.   X, Y, Color : word;
  4712.   XMax, YMax  : integer;
  4713.   ViewInfo    : ViewPortType;
  4714. begin
  4715.   MainWindow('PutPixel / GetPixel demonstration');
  4716.   StatusLine('Esc aborts or press a key...');
  4717.  
  4718.   GetViewSettings(ViewInfo);
  4719.   with ViewInfo do
  4720.   begin
  4721.     XMax := (x2-x1-1);
  4722.     YMax := (y2-y1-1);
  4723.   end;
  4724.  
  4725.   while not KeyPressed do
  4726.   begin
  4727.     { Plot random pixels }
  4728.     RandSeed := Seed;
  4729.     I := 0;
  4730.     while (not KeyPressed) and (I < NumPts) do
  4731.     begin
  4732.       Inc(I);
  4733.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  4734.     end;
  4735.  
  4736.     { Erase pixels }
  4737.     RandSeed := Seed;
  4738.     I := 0;
  4739.     while (not KeyPressed) and (I < NumPts) do
  4740.     begin
  4741.       Inc(I);
  4742.       X := Random(XMax)+1;
  4743.       Y := Random(YMax)+1;
  4744.       Color := GetPixel(X, Y);
  4745.         if Color = RandColor then
  4746.           PutPixel(X, Y, 0);
  4747.      end;
  4748.   end;
  4749.   WaitToGo;
  4750. end; { PutPixelPlay }
  4751.  
  4752. procedure PutImagePlay;
  4753. { Demonstrate the GetImage and PutImage commands }
  4754.  
  4755. const
  4756.   r  = 20;
  4757.   StartX = 100;
  4758.   StartY = 50;
  4759.  
  4760. var
  4761.   CurPort : ViewPortType;
  4762.  
  4763. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  4764. var
  4765.   Step : integer;
  4766. begin
  4767.   Step := Random(2*r);
  4768.   if Odd(Step) then
  4769.     Step := -Step;
  4770.   X := X + Step;
  4771.   Step := Random(r);
  4772.   if Odd(Step) then
  4773.     Step := -Step;
  4774.   Y := Y + Step;
  4775.  
  4776.   { Make saucer bounce off viewport walls }
  4777.   with CurPort do
  4778.   begin
  4779.     if (x1 + X + Width - 1 > x2) then
  4780.       X := x2-x1 - Width + 1
  4781.     else
  4782.       if (X < 0) then
  4783.         X := 0;
  4784.     if (y1 + Y + Height - 1 > y2) then
  4785.       Y := y2-y1 - Height + 1
  4786.     else
  4787.       if (Y < 0) then
  4788.         Y := 0;
  4789.   end;
  4790. end; { MoveSaucer }
  4791.  
  4792. var
  4793.   Pausetime : word;
  4794.   Saucer    : pointer;
  4795.   X, Y      : integer;
  4796.   ulx, uly  : word;
  4797.   lrx, lry  : word;
  4798.   Size      : word;
  4799.   I         : word;
  4800. begin
  4801.   ClearDevice;
  4802.   FullPort;
  4803.  
  4804.   { PaintScreen }
  4805.   ClearDevice;
  4806.   MainWindow('GetImage / PutImage Demonstration');
  4807.   StatusLine('Esc aborts or press a key...');
  4808.   GetViewSettings(CurPort);
  4809.  
  4810.   { DrawSaucer }
  4811.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  4812.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  4813.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  4814.   Circle(StartX+10, StartY-12, 2);
  4815.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  4816.   Circle(StartX-10, StartY-12, 2);
  4817.   SetFillStyle(SolidFill, MaxColor);
  4818.   FloodFill(StartX+1, StartY+4, GetColor);
  4819.  
  4820.   { ReadSaucerImage }
  4821.   ulx := StartX-(r+1);
  4822.   uly := StartY-14;
  4823.   lrx := StartX+(r+1);
  4824.   lry := StartY+(r div 3)+3;
  4825.  
  4826.   Size := ImageSize(ulx, uly, lrx, lry);
  4827.   GetMem(Saucer, Size);
  4828.   GetImage(ulx, uly, lrx, lry, Saucer^);
  4829. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  4830.  
  4831.   { Plot some "stars" }
  4832.   for I := 1 to 1000 do
  4833.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  4834.   X := MaxX div 2;
  4835.   Y := MaxY div 2;
  4836.   PauseTime := 70;
  4837.  
  4838.   { Move the saucer around }
  4839.   repeat
  4840. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  4841.      Delay(PauseTime);
  4842. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  4843.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  4844.   until KeyPressed;
  4845.   FreeMem(Saucer, size);
  4846.   WaitToGo;
  4847. end; { PutImagePlay }
  4848.  
  4849. procedure PolyPlay;
  4850. { Draw random polygons with random fill styles on the screen }
  4851. const
  4852.   MaxPts = 5;
  4853. type
  4854.   PolygonType = array[1..MaxPts] of PointType;
  4855. var
  4856.   Poly : PolygonType;
  4857.   I, Color : word;
  4858. begin
  4859.   MainWindow('FillPoly demonstration');
  4860.   StatusLine('Esc aborts or press a key...');
  4861.   repeat
  4862.     Color := RandColor;
  4863.     SetFillStyle(Random(11)+1, Color);
  4864.     SetColor(Color);
  4865.     for I := 1 to MaxPts do
  4866.       with Poly[I] do
  4867.       begin
  4868.         X := Random(MaxX);
  4869.         Y := Random(MaxY);
  4870.       end;
  4871.     FillPoly(MaxPts, Poly);
  4872.   until KeyPressed;
  4873.   WaitToGo;
  4874. end; { PolyPlay }
  4875.  
  4876. procedure FillStylePlay;
  4877. { Display all of the predefined fill styles available }
  4878. var
  4879.   Style    : word;
  4880.   Width    : word;
  4881.   Height   : word;
  4882.   X, Y     : word;
  4883.   I, J     : word;
  4884.   ViewInfo : ViewPortType;
  4885.  
  4886. procedure DrawBox(X, Y : word);
  4887. begin
  4888.   SetFillStyle(Style, MaxColor);
  4889.   with ViewInfo do
  4890.     Bar(X, Y, X+Width, Y+Height);
  4891.   Rectangle(X, Y, X+Width, Y+Height);
  4892.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  4893.   Inc(Style);
  4894. end; { DrawBox }
  4895.  
  4896. begin
  4897.   MainWindow('Pre-defined fill styles');
  4898.   GetViewSettings(ViewInfo);
  4899.   with ViewInfo do
  4900.   begin
  4901.     Width := 2 * ((x2+1) div 13);
  4902.     Height := 2 * ((y2-10) div 10);
  4903.   end;
  4904.   X := Width div 2;
  4905.   Y := Height div 2;
  4906.   Style := 0;
  4907.   for J := 1 to 3 do
  4908.   begin
  4909.     for I := 1 to 4 do
  4910.     begin
  4911.       DrawBox(X, Y);
  4912.       Inc(X, (Width div 2) * 3);
  4913.     end;
  4914.     X := Width div 2;
  4915.     Inc(Y, (Height div 2) * 3);
  4916.   end;
  4917.   SetTextJustify(LeftText, TopText);
  4918.   WaitToGo;
  4919. end; { FillStylePlay }
  4920.  
  4921. procedure FillPatternPlay;
  4922. { Display some user defined fill patterns }
  4923. const
  4924.   Patterns : array[0..11] of FillPatternType = (
  4925.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  4926.             OldColor which has a path of pixels of OldColor or NewColor
  4927.             with sides touching back to the seed point, (XSeed, YSeed).
  4928.             Therefore, only pixels of OldColor are modified and no other
  4929.             information is changed.
  4930.  
  4931.             SEE ALSO
  4932.  
  4933.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  4934.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  4935.             SETVIEW
  4936.  
  4937.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  4938.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  4939.             IF WHICHVGA = 0 THEN STOP
  4940.             DUMMY=RES640
  4941.             SETVIEW 100, 100, 539, 379
  4942.             FILLVIEW 10
  4943.             WHILE INKEY$ = ""
  4944.             WEND
  4945.             VIDEOMODESET VMODE
  4946.             END
  4947.  
  4948.  
  4949.  
  4950.  
  4951.  
  4952.  
  4953.  
  4954.  
  4955.  
  4956.  
  4957.  
  4958.  
  4959.  
  4960.  
  4961.  
  4962.  
  4963.                                                                          63
  4964.  
  4965.  
  4966.  
  4967.  
  4968.  
  4969.           FONTGETINFO
  4970.  
  4971.             PROTOTYPE
  4972.  
  4973.             SUB FONTGETINFO (Width%, Height%)
  4974.  
  4975.             INPUT
  4976.  
  4977.             no input parameters
  4978.     WEND
  4979.             MOUSEEXIT
  4980.             VIDEOMODESET VMODE
  4981.             END
  4982.  
  4983.  
  4984.  
  4985.  
  4986.  
  4987.  
  4988.  
  4989.  
  4990.  
  4991.  
  4992.  
  4993.  
  4994.  
  4995.  
  4996.  
  4997.  
  4998.  
  4999.  
  5000.  
  5001.  
  5002.  
  5003.  
  5004.  
  5005.  
  5006.  
  5007.  
  5008.  
  5009.  
  5010.  
  5011.  
  5012.  
  5013.  
  5014.  
  5015.  
  5016.  
  5017.  
  5018.  
  5019.  
  5020.  
  5021.  
  5022.                                                                          86
  5023.  
  5024.  
  5025.  
  5026.  
  5027.  
  5028.           MOUSECURSORDEFAULT
  5029.  
  5030.             PROTOTYPE
  5031.  
  5032.             SUB MOUSECURSORDEFAULT ()
  5033.  
  5034.             INPUT
  5035.  
  5036.             no input parameters
  5037.  
  5038.             OUTPUT
  5039.  
  5040.             no value returned
  5041.  
  5042.             USAGE
  5043.  
  5044.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  5045.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  5046. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  5047. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  5048. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  5049. $╤
  5050. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  5051. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  5052. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  5053.       end;
  5054.     end;
  5055.   end;
  5056.   WaitToGo;
  5057. end; { UserLineStylePlay }
  5058.  
  5059.  
  5060. procedure SayGoodbye;
  5061. { Say goodbye and then exit the program }
  5062. var
  5063.   ViewInfo : ViewPortType;
  5064. begin
  5065.   MainWindow('');
  5066.   GetViewSettings(ViewInfo);
  5067.   SetTextStyle(TriplexFont, HorizDir, 4);
  5068.   SetTextJustify(CenterText, CenterText);
  5069.   with ViewInfo do
  5070.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  5071.   StatusLine('Press any key to quit...');
  5072.   repeat until KeyPressed;
  5073. end; { SayGoodbye }
  5074.  
  5075.  
  5076. PROCEDURE SelectMode;
  5077. VAR
  5078.     choice1,choice2     : CHAR;
  5079.    xsize,ysize            : WORD;
  5080. BEGIN
  5081.     (* Let's select a mode *)
  5082.     ClrScr;
  5083.     WriteLn('VESADEMO:');
  5084.     WriteLn('1. 256 colors');
  5085.     WriteLn('2. 32768 colors');
  5086.     WriteLn('3. 65536 colors');
  5087.     WriteLn('4. 16777216 colors');
  5088.     WriteLn('Q uit');
  5089.     WriteLn;
  5090.     Write('Your choice: ');
  5091.     REPEAT
  5092.         ReadLn(choice1);
  5093.       IF choice1 <> '1' THEN BEGIN
  5094.           WriteLn('Sorry !');
  5095.          WriteLn('This demo wasn''t written for more as 256 colors !');
  5096.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  5097.          WriteLn('Switching to 256 colors.');
  5098.          choice1 := '1';
  5099.       END;
  5100.     UNTIL choice1 IN ['1'..'4','q'];
  5101.     IF choice1 = 'q' THEN Halt;
  5102.  
  5103.     WriteLn;
  5104.     WriteLn;
  5105.     WriteLn('a. 320x200');
  5106.     WriteLn('b. 640x480');
  5107.     WriteLn('c. 800x600');
  5108.     WriteLn('d. 1024x768');
  5109.     WriteLn('e. 1280x1024');
  5110.     WriteLn('Q uit');
  5111.     WriteLn;
  5112.     Write('Your choice: ');
  5113.     REPEAT
  5114.         ReadLn(choice2);
  5115.     UNTIL choice2 IN ['a'..'e','q'];
  5116.     IF choice2 = 'q' THEN Halt;
  5117.  
  5118.     CASE choice2 OF
  5119.         'a' : BEGIN
  5120.             xsize := 320;
  5121.             ysize := 200;
  5122.         END;
  5123.         'b' : BEGIN
  5124.             xsize := 640;
  5125.             ysize := 480;
  5126.         END;
  5127.         'c' : BEGIN
  5128.             xsize := 800;
  5129.             ysize := 600;
  5130.         END;
  5131.         'd' : BEGIN
  5132.             xsize := 1024;
  5133.             ysize := 768;
  5134.         END;
  5135.         'e' : BEGIN
  5136.             xsize := 1280;
  5137.             ysize := 1024;
  5138.         END;
  5139.     END;
  5140.     CASE choice1 OF
  5141.         '1' : mode := FindVesaMode(xsize,ysize,8);
  5142.         '2' : mode := FindVesaMode(xsize,ysize,15);
  5143.         '3' : mode := FindVesaMode(xsize,ysize,16);
  5144.         '4' : mode := FindVesaMode(xsize,ysize,24);
  5145.     END;
  5146.     IF mode = 0 THEN BEGIN
  5147.         WriteLn('No such mode could be found !');
  5148.         WriteLn('Switching to to 320x200.');
  5149.         ReadKey;
  5150.         mode := V320x200x256;
  5151.     END;
  5152. END;
  5153.  
  5154. begin { program body }
  5155.   SelectMode;
  5156.   Initialize;
  5157.   ReportStatus;
  5158.  
  5159. {  AspectRatioPlay; }
  5160.   FillEllipsePlay;
  5161.   SectorPlay;
  5162.   WriteModePlay;
  5163.  
  5164.   ColorPlay;
  5165.   { PalettePlay only intended to work on these drivers: }
  5166.   if (GraphDriver = EGA) or
  5167.       (GraphDriver = EGA64) or
  5168.       (GraphDriver = VGA) then
  5169.      PalettePlay;
  5170.   PutPixelPlay;
  5171. {  PutImagePlay; }
  5172.   RandBarPlay;
  5173.   BarPlay;
  5174.   Bar3DPlay;
  5175.   ArcPlay;
  5176.   CirclePlay;
  5177.   PiePlay;
  5178.   LineToPlay;
  5179.   LineRelPlay;
  5180. {  LineStylePlay; }
  5181. {  UserLineStylePlay; }
  5182.   TextDump;
  5183.   TextPlay;
  5184.   CrtModePlay;
  5185.   FillStylePlay;
  5186.   FillPatternPlay;
  5187.   PolyPlay;
  5188.   SayGoodbye;
  5189. {  CloseGraph; }
  5190.   CloseVesa;
  5191. end.
  5192. ***************************************************
  5193.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  5194.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  5195. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  5196. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  5197.     Color := RandColor;
  5198.     SetColor(Color);
  5199.     SetFillStyle(Random(CloseDotFill)+1, Color);
  5200.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  5201.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  5202.   until KeyPressed;
  5203.   WaitToGo;
  5204. end; { RandBarPlay }
  5205.  
  5206. procedure ArcPlay;
  5207. { Draw random arcs on the screen }
  5208. var
  5209.   MaxRadius : word;
  5210.   EndAngle : word;
  5211.   ArcInfo : ArcCoordsType;
  5212. begin
  5213.   MainWindow('Arc / GetArcCoords demonstration');
  5214.   StatusLine('Esc aborts or press a key');
  5215.   MaxRadius := MaxY div 10;
  5216.   repeat
  5217.     SetColor(RandColor);
  5218.     EndAngle := Random(360);
  5219.     SetLineStyle(SolidLn, 0, NormWidth);
  5220.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  5221.     GetArcCoords(ArcInfo);
  5222.     with ArcInfo do
  5223.     begin
  5224.       Line(X, Y, XStart, YStart);
  5225.       Line(X, Y, Xend, Yend);
  5226.     end;
  5227.   until KeyPressed;
  5228.   WaitToGo;
  5229. end; { ArcPlay }
  5230.  
  5231. procedure PutPixelPlay;
  5232. { Demonstrate the PutPixel and GetPixel commands }
  5233. const
  5234.   Seed   = 1962; { A seed for the random number generator }
  5235.   NumPts = 2000; { The number of pixels plotted }
  5236.   Esc    = #27;
  5237. var
  5238.   I : word;
  5239.   X, Y, Color : word;
  5240.   XMax, YMax  : integer;
  5241.   ViewInfo    : ViewPortType;
  5242. begin
  5243.   MainWindow('PutPixel / GetPixel demonstration');
  5244.   StatusLine('Esc aborts or press a key...');
  5245.  
  5246.   GetViewSettings(ViewInfo);
  5247.   with ViewInfo do
  5248.   begin
  5249.     XMax := (x2-x1-1);
  5250.     YMax := (y2-y1-1);
  5251.   end;
  5252.  
  5253.   while not KeyPressed do
  5254.   begin
  5255.     { Plot random pixels }
  5256.     RandSeed := Seed;
  5257.     I := 0;
  5258.     while (not KeyPressed) and (I < NumPts) do
  5259.     begin
  5260.       Inc(I);
  5261.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  5262.     end;
  5263.  
  5264.     { Erase pixels }
  5265.     RandSeed := Seed;
  5266.     I := 0;
  5267.     while (not KeyPressed) and (I < NumPts) do
  5268.     begin
  5269.       Inc(I);
  5270.       X := Random(XMax)+1;
  5271.       Y := Random(YMax)+1;
  5272.       Color := GetPixel(X, Y);
  5273.         if Color = RandColor then
  5274.           PutPixel(X, Y, 0);
  5275.      end;
  5276.   end;
  5277.   WaitToGo;
  5278. end; { PutPixelPlay }
  5279.  
  5280. procedure PutImagePlay;
  5281. { Demonstrate the GetImage and PutImage commands }
  5282.  
  5283. const
  5284.   r  = 20;
  5285.   StartX = 100;
  5286.   StartY = 50;
  5287.  
  5288. var
  5289.   CurPort : ViewPortType;
  5290.  
  5291. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  5292. var
  5293.   Step : integer;
  5294. begin
  5295.   Step := Random(2*r);
  5296.   if Odd(Step) then
  5297.     Step := -Step;
  5298.   X := X + Step;
  5299.   Step := Random(r);
  5300.   if Odd(Step) then
  5301.     Step := -Step;
  5302.   Y := Y + Step;
  5303.  
  5304.   { Make saucer bounce off viewport walls }
  5305.   with CurPort do
  5306.   begin
  5307.     if (x1 + X + Width - 1 > x2) then
  5308.       X := x2-x1 - Width + 1
  5309.     else
  5310.       if (X < 0) then
  5311.         X := 0;
  5312.     if (y1 + Y + Height - 1 > y2) then
  5313.       Y := y2-y1 - Height + 1
  5314.     else
  5315.       if (Y < 0) then
  5316.         Y := 0;
  5317.   end;
  5318. end; { MoveSaucer }
  5319.  
  5320. var
  5321.   Pausetime : word;
  5322.   Saucer    : pointer;
  5323.   X, Y      : integer;
  5324.   ulx, uly  : word;
  5325.   lrx, lry  : word;
  5326.   Size      : word;
  5327.   I         : word;
  5328. begin
  5329.   ClearDevice;
  5330.   FullPort;
  5331.  
  5332.   { PaintScreen }
  5333.   ClearDevice;
  5334.   MainWindow('GetImage / PutImage Demonstration');
  5335.   StatusLine('Esc aborts or press a key...');
  5336.   GetViewSettings(CurPort);
  5337.  
  5338.   { DrawSaucer }
  5339.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  5340.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  5341.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  5342.   Circle(StartX+10, StartY-12, 2);
  5343.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  5344.   Circle(StartX-10, StartY-12, 2);
  5345.   SetFillStyle(SolidFill, MaxColor);
  5346.   FloodFill(StartX+1, StartY+4, GetColor);
  5347.  
  5348.   { ReadSaucerImage }
  5349.   ulx := StartX-(r+1);
  5350.   uly := StartY-14;
  5351.   lrx := StartX+(r+1);
  5352.   lry := StartY+(r div 3)+3;
  5353.  
  5354.   Size := ImageSize(ulx, uly, lrx, lry);
  5355.   GetMem(Saucer, Size);
  5356.   GetImage(ulx, uly, lrx, lry, Saucer^);
  5357. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  5358.  
  5359.   { Plot some "stars" }
  5360.   for I := 1 to 1000 do
  5361.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  5362.   X := MaxX div 2;
  5363.   Y := MaxY div 2;
  5364.   PauseTime := 70;
  5365.  
  5366.   { Move the saucer around }
  5367.   repeat
  5368. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  5369.      Delay(PauseTime);
  5370. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  5371.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  5372.   until KeyPressed;
  5373.   FreeMem(Saucer, size);
  5374.   WaitToGo;
  5375. end; { PutImagePlay }
  5376.  
  5377. procedure PolyPlay;
  5378. { Draw random polygons with random fill styles on the screen }
  5379. const
  5380.   MaxPts = 5;
  5381. type
  5382.   PolygonType = array[1..MaxPts] of PointType;
  5383. var
  5384.   Poly : PolygonType;
  5385.   I, Color : word;
  5386. begin
  5387.   MainWindow('FillPoly demonstration');
  5388.   StatusLine('Esc aborts or press a key...');
  5389.   repeat
  5390.     Color := RandColor;
  5391.     SetFillStyle(Random(11)+1, Color);
  5392.     SetColor(Color);
  5393.     for I := 1 to MaxPts do
  5394.       with Poly[I] do
  5395.       begin
  5396.         X := Random(MaxX);
  5397.         Y := Random(MaxY);
  5398.       end;
  5399.     FillPoly(MaxPts, Poly);
  5400.   until KeyPressed;
  5401.   WaitToGo;
  5402. end; { PolyPlay }
  5403.  
  5404. procedure FillStylePlay;
  5405. { Display all of the predefined fill styles available }
  5406. var
  5407.   Style    : word;
  5408.   Width    : word;
  5409.   Height   : word;
  5410.   X, Y     : word;
  5411.   I, J     : word;
  5412.   ViewInfo : ViewPortType;
  5413.  
  5414. procedure DrawBox(X, Y : word);
  5415. begin
  5416.   SetFillStyle(Style, MaxColor);
  5417.   with ViewInfo do
  5418.     Bar(X, Y, X+Width, Y+Height);
  5419.   Rectangle(X, Y, X+Width, Y+Height);
  5420.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  5421.   Inc(Style);
  5422. end; { DrawBox }
  5423.  
  5424. begin
  5425.   MainWindow('Pre-defined fill styles');
  5426.   GetViewSettings(ViewInfo);
  5427.   with ViewInfo do
  5428.   begin
  5429.     Width := 2 * ((x2+1) div 13);
  5430.     Height := 2 * ((y2-10) div 10);
  5431.   end;
  5432.   X := Width div 2;
  5433.   Y := Height div 2;
  5434.   Style := 0;
  5435.   for J := 1 to 3 do
  5436.   begin
  5437.     for I := 1 to 4 do
  5438.     begin
  5439.       DrawBox(X, Y);
  5440.       Inc(X, (Width div 2) * 3);
  5441.     end;
  5442.     X := Width div 2;
  5443.     Inc(Y, (Height div 2) * 3);
  5444.   end;
  5445.   SetTextJustify(LeftText, TopText);
  5446.   WaitToGo;
  5447. end; { FillStylePlay }
  5448.  
  5449. procedure FillPatternPlay;
  5450. { Display some user defined fill patterns }
  5451. const
  5452.   Patterns : array[0..11] of FillPatternType = (
  5453.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  5454.             OldColor which has a path of pixels of OldColor or NewColor
  5455.             with sides touching back to the seed point, (XSeed, YSeed).
  5456.             Therefore, only pixels of OldColor are modified and no other
  5457.             information is changed.
  5458.  
  5459.             SEE ALSO
  5460.  
  5461.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  5462.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  5463.             SETVIEW
  5464.  
  5465.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  5466.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  5467.             IF WHICHVGA = 0 THEN STOP
  5468.             DUMMY=RES640
  5469.             SETVIEW 100, 100, 539, 379
  5470.             FILLVIEW 10
  5471.             WHILE INKEY$ = ""
  5472.             WEND
  5473.             VIDEOMODESET VMODE
  5474.             END
  5475.  
  5476.  
  5477.  
  5478.  
  5479.  
  5480.  
  5481.  
  5482.  
  5483.  
  5484.  
  5485.  
  5486.  
  5487.  
  5488.  
  5489.  
  5490.  
  5491.                                                                          63
  5492.  
  5493.  
  5494.  
  5495.  
  5496.  
  5497.           FONTGETINFO
  5498.  
  5499.             PROTOTYPE
  5500.  
  5501.             SUB FONTGETINFO (Width%, Height%)
  5502.  
  5503.             INPUT
  5504.  
  5505.             no input parameters
  5506.     WEND
  5507.             MOUSEEXIT
  5508.             VIDEOMODESET VMODE
  5509.             END
  5510.  
  5511.  
  5512.  
  5513.  
  5514.  
  5515.  
  5516.  
  5517.  
  5518.  
  5519.  
  5520.  
  5521.  
  5522.  
  5523.  
  5524.  
  5525.  
  5526.  
  5527.  
  5528.  
  5529.  
  5530.  
  5531.  
  5532.  
  5533.  
  5534.  
  5535.  
  5536.  
  5537.  
  5538.  
  5539.  
  5540.  
  5541.  
  5542.  
  5543.  
  5544.  
  5545.  
  5546.  
  5547.  
  5548.  
  5549.  
  5550.                                                                          86
  5551.  
  5552.  
  5553.  
  5554.  
  5555.  
  5556.           MOUSECURSORDEFAULT
  5557.  
  5558.             PROTOTYPE
  5559.  
  5560.             SUB MOUSECURSORDEFAULT ()
  5561.  
  5562.             INPUT
  5563.  
  5564.             no input parameters
  5565.  
  5566.             OUTPUT
  5567.  
  5568.             no value returned
  5569.  
  5570.             USAGE
  5571.  
  5572.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  5573.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  5574. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  5575. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  5576. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  5577. $╤
  5578. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  5579. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  5580. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  5581.       end;
  5582.     end;
  5583.   end;
  5584.   WaitToGo;
  5585. end; { UserLineStylePlay }
  5586.  
  5587.  
  5588. procedure SayGoodbye;
  5589. { Say goodbye and then exit the program }
  5590. var
  5591.   ViewInfo : ViewPortType;
  5592. begin
  5593.   MainWindow('');
  5594.   GetViewSettings(ViewInfo);
  5595.   SetTextStyle(TriplexFont, HorizDir, 4);
  5596.   SetTextJustify(CenterText, CenterText);
  5597.   with ViewInfo do
  5598.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  5599.   StatusLine('Press any key to quit...');
  5600.   repeat until KeyPressed;
  5601. end; { SayGoodbye }
  5602.  
  5603.  
  5604. PROCEDURE SelectMode;
  5605. VAR
  5606.     choice1,choice2     : CHAR;
  5607.    xsize,ysize            : WORD;
  5608. BEGIN
  5609.     (* Let's select a mode *)
  5610.     ClrScr;
  5611.     WriteLn('VESADEMO:');
  5612.     WriteLn('1. 256 colors');
  5613.     WriteLn('2. 32768 colors');
  5614.     WriteLn('3. 65536 colors');
  5615.     WriteLn('4. 16777216 colors');
  5616.     WriteLn('Q uit');
  5617.     WriteLn;
  5618.     Write('Your choice: ');
  5619.     REPEAT
  5620.         ReadLn(choice1);
  5621.       IF choice1 <> '1' THEN BEGIN
  5622.           WriteLn('Sorry !');
  5623.          WriteLn('This demo wasn''t written for more as 256 colors !');
  5624.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  5625.          WriteLn('Switching to 256 colors.');
  5626.          choice1 := '1';
  5627.       END;
  5628.     UNTIL choice1 IN ['1'..'4','q'];
  5629.     IF choice1 = 'q' THEN Halt;
  5630.  
  5631.     WriteLn;
  5632.     WriteLn;
  5633.     WriteLn('a. 320x200');
  5634.     WriteLn('b. 640x480');
  5635.     WriteLn('c. 800x600');
  5636.     WriteLn('d. 1024x768');
  5637.     WriteLn('e. 1280x1024');
  5638.     WriteLn('Q uit');
  5639.     WriteLn;
  5640.     Write('Your choice: ');
  5641.     REPEAT
  5642.         ReadLn(choice2);
  5643.     UNTIL choice2 IN ['a'..'e','q'];
  5644.     IF choice2 = 'q' THEN Halt;
  5645.  
  5646.     CASE choice2 OF
  5647.         'a' : BEGIN
  5648.             xsize := 320;
  5649.             ysize := 200;
  5650.         END;
  5651.         'b' : BEGIN
  5652.             xsize := 640;
  5653.             ysize := 480;
  5654.         END;
  5655.         'c' : BEGIN
  5656.             xsize := 800;
  5657.             ysize := 600;
  5658.         END;
  5659.         'd' : BEGIN
  5660.             xsize := 1024;
  5661.             ysize := 768;
  5662.         END;
  5663.         'e' : BEGIN
  5664.             xsize := 1280;
  5665.             ysize := 1024;
  5666.         END;
  5667.     END;
  5668.     CASE choice1 OF
  5669.         '1' : mode := FindVesaMode(xsize,ysize,8);
  5670.         '2' : mode := FindVesaMode(xsize,ysize,15);
  5671.         '3' : mode := FindVesaMode(xsize,ysize,16);
  5672.         '4' : mode := FindVesaMode(xsize,ysize,24);
  5673.     END;
  5674.     IF mode = 0 THEN BEGIN
  5675.         WriteLn('No such mode could be found !');
  5676.         WriteLn('Switching to to 320x200.');
  5677.         ReadKey;
  5678.         mode := V320x200x256;
  5679.     END;
  5680. END;
  5681.  
  5682. begin { program body }
  5683.   SelectMode;
  5684.   Initialize;
  5685.   ReportStatus;
  5686.  
  5687. {  AspectRatioPlay; }
  5688.   FillEllipsePlay;
  5689.   SectorPlay;
  5690.   WriteModePlay;
  5691.  
  5692.   ColorPlay;
  5693.   { PalettePlay only intended to work on these drivers: }
  5694.   if (GraphDriver = EGA) or
  5695.       (GraphDriver = EGA64) or
  5696.       (GraphDriver = VGA) then
  5697.      PalettePlay;
  5698.   PutPixelPlay;
  5699. {  PutImagePlay; }
  5700.   RandBarPlay;
  5701.   BarPlay;
  5702.   Bar3DPlay;
  5703.   ArcPlay;
  5704.   CirclePlay;
  5705.   PiePlay;
  5706.   LineToPlay;
  5707.   LineRelPlay;
  5708. {  LineStylePlay; }
  5709. {  UserLineStylePlay; }
  5710.   TextDump;
  5711.   TextPlay;
  5712.   CrtModePlay;
  5713.   FillStylePlay;
  5714.   FillPatternPlay;
  5715.   PolyPlay;
  5716.   SayGoodbye;
  5717. {  CloseGraph; }
  5718.   CloseVesa;
  5719. end.
  5720. ***************************************************
  5721.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  5722.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  5723. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  5724. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  5725.     Color := RandColor;
  5726.     SetColor(Color);
  5727.     SetFillStyle(Random(CloseDotFill)+1, Color);
  5728.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  5729.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  5730.   until KeyPressed;
  5731.   WaitToGo;
  5732. end; { RandBarPlay }
  5733.  
  5734. procedure ArcPlay;
  5735. { Draw random arcs on the screen }
  5736. var
  5737.   MaxRadius : word;
  5738.   EndAngle : word;
  5739.   ArcInfo : ArcCoordsType;
  5740. begin
  5741.   MainWindow('Arc / GetArcCoords demonstration');
  5742.   StatusLine('Esc aborts or press a key');
  5743.   MaxRadius := MaxY div 10;
  5744.   repeat
  5745.     SetColor(RandColor);
  5746.     EndAngle := Random(360);
  5747.     SetLineStyle(SolidLn, 0, NormWidth);
  5748.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  5749.     GetArcCoords(ArcInfo);
  5750.     with ArcInfo do
  5751.     begin
  5752.       Line(X, Y, XStart, YStart);
  5753.       Line(X, Y, Xend, Yend);
  5754.     end;
  5755.   until KeyPressed;
  5756.   WaitToGo;
  5757. end; { ArcPlay }
  5758.  
  5759. procedure PutPixelPlay;
  5760. { Demonstrate the PutPixel and GetPixel commands }
  5761. const
  5762.   Seed   = 1962; { A seed for the random number generator }
  5763.   NumPts = 2000; { The number of pixels plotted }
  5764.   Esc    = #27;
  5765. var
  5766.   I : word;
  5767.   X, Y, Color : word;
  5768.   XMax, YMax  : integer;
  5769.   ViewInfo    : ViewPortType;
  5770. begin
  5771.   MainWindow('PutPixel / GetPixel demonstration');
  5772.   StatusLine('Esc aborts or press a key...');
  5773.  
  5774.   GetViewSettings(ViewInfo);
  5775.   with ViewInfo do
  5776.   begin
  5777.     XMax := (x2-x1-1);
  5778.     YMax := (y2-y1-1);
  5779.   end;
  5780.  
  5781.   while not KeyPressed do
  5782.   begin
  5783.     { Plot random pixels }
  5784.     RandSeed := Seed;
  5785.     I := 0;
  5786.     while (not KeyPressed) and (I < NumPts) do
  5787.     begin
  5788.       Inc(I);
  5789.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  5790.     end;
  5791.  
  5792.     { Erase pixels }
  5793.     RandSeed := Seed;
  5794.     I := 0;
  5795.     while (not KeyPressed) and (I < NumPts) do
  5796.     begin
  5797.       Inc(I);
  5798.       X := Random(XMax)+1;
  5799.       Y := Random(YMax)+1;
  5800.       Color := GetPixel(X, Y);
  5801.         if Color = RandColor then
  5802.           PutPixel(X, Y, 0);
  5803.      end;
  5804.   end;
  5805.   WaitToGo;
  5806. end; { PutPixelPlay }
  5807.  
  5808. procedure PutImagePlay;
  5809. { Demonstrate the GetImage and PutImage commands }
  5810.  
  5811. const
  5812.   r  = 20;
  5813.   StartX = 100;
  5814.   StartY = 50;
  5815.  
  5816. var
  5817.   CurPort : ViewPortType;
  5818.  
  5819. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  5820. var
  5821.   Step : integer;
  5822. begin
  5823.   Step := Random(2*r);
  5824.   if Odd(Step) then
  5825.     Step := -Step;
  5826.   X := X + Step;
  5827.   Step := Random(r);
  5828.   if Odd(Step) then
  5829.     Step := -Step;
  5830.   Y := Y + Step;
  5831.  
  5832.   { Make saucer bounce off viewport walls }
  5833.   with CurPort do
  5834.   begin
  5835.     if (x1 + X + Width - 1 > x2) then
  5836.       X := x2-x1 - Width + 1
  5837.     else
  5838.       if (X < 0) then
  5839.         X := 0;
  5840.     if (y1 + Y + Height - 1 > y2) then
  5841.       Y := y2-y1 - Height + 1
  5842.     else
  5843.       if (Y < 0) then
  5844.         Y := 0;
  5845.   end;
  5846. end; { MoveSaucer }
  5847.  
  5848. var
  5849.   Pausetime : word;
  5850.   Saucer    : pointer;
  5851.   X, Y      : integer;
  5852.   ulx, uly  : word;
  5853.   lrx, lry  : word;
  5854.   Size      : word;
  5855.   I         : word;
  5856. begin
  5857.   ClearDevice;
  5858.   FullPort;
  5859.  
  5860.   { PaintScreen }
  5861.   ClearDevice;
  5862.   MainWindow('GetImage / PutImage Demonstration');
  5863.   StatusLine('Esc aborts or press a key...');
  5864.   GetViewSettings(CurPort);
  5865.  
  5866.   { DrawSaucer }
  5867.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  5868.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  5869.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  5870.   Circle(StartX+10, StartY-12, 2);
  5871.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  5872.   Circle(StartX-10, StartY-12, 2);
  5873.   SetFillStyle(SolidFill, MaxColor);
  5874.   FloodFill(StartX+1, StartY+4, GetColor);
  5875.  
  5876.   { ReadSaucerImage }
  5877.   ulx := StartX-(r+1);
  5878.   uly := StartY-14;
  5879.   lrx := StartX+(r+1);
  5880.   lry := StartY+(r div 3)+3;
  5881.  
  5882.   Size := ImageSize(ulx, uly, lrx, lry);
  5883.   GetMem(Saucer, Size);
  5884.   GetImage(ulx, uly, lrx, lry, Saucer^);
  5885. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  5886.  
  5887.   { Plot some "stars" }
  5888.   for I := 1 to 1000 do
  5889.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  5890.   X := MaxX div 2;
  5891.   Y := MaxY div 2;
  5892.   PauseTime := 70;
  5893.  
  5894.   { Move the saucer around }
  5895.   repeat
  5896. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  5897.      Delay(PauseTime);
  5898. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  5899.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  5900.   until KeyPressed;
  5901.   FreeMem(Saucer, size);
  5902.   WaitToGo;
  5903. end; { PutImagePlay }
  5904.  
  5905. procedure PolyPlay;
  5906. { Draw random polygons with random fill styles on the screen }
  5907. const
  5908.   MaxPts = 5;
  5909. type
  5910.   PolygonType = array[1..MaxPts] of PointType;
  5911. var
  5912.   Poly : PolygonType;
  5913.   I, Color : word;
  5914. begin
  5915.   MainWindow('FillPoly demonstration');
  5916.   StatusLine('Esc aborts or press a key...');
  5917.   repeat
  5918.     Color := RandColor;
  5919.     SetFillStyle(Random(11)+1, Color);
  5920.     SetColor(Color);
  5921.     for I := 1 to MaxPts do
  5922.       with Poly[I] do
  5923.       begin
  5924.         X := Random(MaxX);
  5925.         Y := Random(MaxY);
  5926.       end;
  5927.     FillPoly(MaxPts, Poly);
  5928.   until KeyPressed;
  5929.   WaitToGo;
  5930. end; { PolyPlay }
  5931.  
  5932. procedure FillStylePlay;
  5933. { Display all of the predefined fill styles available }
  5934. var
  5935.   Style    : word;
  5936.   Width    : word;
  5937.   Height   : word;
  5938.   X, Y     : word;
  5939.   I, J     : word;
  5940.   ViewInfo : ViewPortType;
  5941.  
  5942. procedure DrawBox(X, Y : word);
  5943. begin
  5944.   SetFillStyle(Style, MaxColor);
  5945.   with ViewInfo do
  5946.     Bar(X, Y, X+Width, Y+Height);
  5947.   Rectangle(X, Y, X+Width, Y+Height);
  5948.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  5949.   Inc(Style);
  5950. end; { DrawBox }
  5951.  
  5952. begin
  5953.   MainWindow('Pre-defined fill styles');
  5954.   GetViewSettings(ViewInfo);
  5955.   with ViewInfo do
  5956.   begin
  5957.     Width := 2 * ((x2+1) div 13);
  5958.     Height := 2 * ((y2-10) div 10);
  5959.   end;
  5960.   X := Width div 2;
  5961.   Y := Height div 2;
  5962.   Style := 0;
  5963.   for J := 1 to 3 do
  5964.   begin
  5965.     for I := 1 to 4 do
  5966.     begin
  5967.       DrawBox(X, Y);
  5968.       Inc(X, (Width div 2) * 3);
  5969.     end;
  5970.     X := Width div 2;
  5971.     Inc(Y, (Height div 2) * 3);
  5972.   end;
  5973.   SetTextJustify(LeftText, TopText);
  5974.   WaitToGo;
  5975. end; { FillStylePlay }
  5976.  
  5977. procedure FillPatternPlay;
  5978. { Display some user defined fill patterns }
  5979. const
  5980.   Patterns : array[0..11] of FillPatternType = (
  5981.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  5982.             OldColor which has a path of pixels of OldColor or NewColor
  5983.             with sides touching back to the seed point, (XSeed, YSeed).
  5984.             Therefore, only pixels of OldColor are modified and no other
  5985.             information is changed.
  5986.  
  5987.             SEE ALSO
  5988.  
  5989.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  5990.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  5991.             SETVIEW
  5992.  
  5993.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  5994.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  5995.             IF WHICHVGA = 0 THEN STOP
  5996.             DUMMY=RES640
  5997.             SETVIEW 100, 100, 539, 379
  5998.             FILLVIEW 10
  5999.             WHILE INKEY$ = ""
  6000.             WEND
  6001.             VIDEOMODESET VMODE
  6002.             END
  6003.  
  6004.  
  6005.  
  6006.  
  6007.  
  6008.  
  6009.  
  6010.  
  6011.  
  6012.  
  6013.  
  6014.  
  6015.  
  6016.  
  6017.  
  6018.  
  6019.                                                                          63
  6020.  
  6021.  
  6022.  
  6023.  
  6024.  
  6025.           FONTGETINFO
  6026.  
  6027.             PROTOTYPE
  6028.  
  6029.             SUB FONTGETINFO (Width%, Height%)
  6030.  
  6031.             INPUT
  6032.  
  6033.             no input parameters
  6034.     WEND
  6035.             MOUSEEXIT
  6036.             VIDEOMODESET VMODE
  6037.             END
  6038.  
  6039.  
  6040.  
  6041.  
  6042.  
  6043.  
  6044.  
  6045.  
  6046.  
  6047.  
  6048.  
  6049.  
  6050.  
  6051.  
  6052.  
  6053.  
  6054.  
  6055.  
  6056.  
  6057.  
  6058.  
  6059.  
  6060.  
  6061.  
  6062.  
  6063.  
  6064.  
  6065.  
  6066.  
  6067.  
  6068.  
  6069.  
  6070.  
  6071.  
  6072.  
  6073.  
  6074.  
  6075.  
  6076.  
  6077.  
  6078.                                                                          86
  6079.  
  6080.  
  6081.  
  6082.  
  6083.  
  6084.           MOUSECURSORDEFAULT
  6085.  
  6086.             PROTOTYPE
  6087.  
  6088.             SUB MOUSECURSORDEFAULT ()
  6089.  
  6090.             INPUT
  6091.  
  6092.             no input parameters
  6093.  
  6094.             OUTPUT
  6095.  
  6096.             no value returned
  6097.  
  6098.             USAGE
  6099.  
  6100.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  6101.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  6102. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  6103. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  6104. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  6105. $╤
  6106. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  6107. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  6108. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  6109.       end;
  6110.     end;
  6111.   end;
  6112.   WaitToGo;
  6113. end; { UserLineStylePlay }
  6114.  
  6115.  
  6116. procedure SayGoodbye;
  6117. { Say goodbye and then exit the program }
  6118. var
  6119.   ViewInfo : ViewPortType;
  6120. begin
  6121.   MainWindow('');
  6122.   GetViewSettings(ViewInfo);
  6123.   SetTextStyle(TriplexFont, HorizDir, 4);
  6124.   SetTextJustify(CenterText, CenterText);
  6125.   with ViewInfo do
  6126.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  6127.   StatusLine('Press any key to quit...');
  6128.   repeat until KeyPressed;
  6129. end; { SayGoodbye }
  6130.  
  6131.  
  6132. PROCEDURE SelectMode;
  6133. VAR
  6134.     choice1,choice2     : CHAR;
  6135.    xsize,ysize            : WORD;
  6136. BEGIN
  6137.     (* Let's select a mode *)
  6138.     ClrScr;
  6139.     WriteLn('VESADEMO:');
  6140.     WriteLn('1. 256 colors');
  6141.     WriteLn('2. 32768 colors');
  6142.     WriteLn('3. 65536 colors');
  6143.     WriteLn('4. 16777216 colors');
  6144.     WriteLn('Q uit');
  6145.     WriteLn;
  6146.     Write('Your choice: ');
  6147.     REPEAT
  6148.         ReadLn(choice1);
  6149.       IF choice1 <> '1' THEN BEGIN
  6150.           WriteLn('Sorry !');
  6151.          WriteLn('This demo wasn''t written for more as 256 colors !');
  6152.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  6153.          WriteLn('Switching to 256 colors.');
  6154.          choice1 := '1';
  6155.       END;
  6156.     UNTIL choice1 IN ['1'..'4','q'];
  6157.     IF choice1 = 'q' THEN Halt;
  6158.  
  6159.     WriteLn;
  6160.     WriteLn;
  6161.     WriteLn('a. 320x200');
  6162.     WriteLn('b. 640x480');
  6163.     WriteLn('c. 800x600');
  6164.     WriteLn('d. 1024x768');
  6165.     WriteLn('e. 1280x1024');
  6166.     WriteLn('Q uit');
  6167.     WriteLn;
  6168.     Write('Your choice: ');
  6169.     REPEAT
  6170.         ReadLn(choice2);
  6171.     UNTIL choice2 IN ['a'..'e','q'];
  6172.     IF choice2 = 'q' THEN Halt;
  6173.  
  6174.     CASE choice2 OF
  6175.         'a' : BEGIN
  6176.             xsize := 320;
  6177.             ysize := 200;
  6178.         END;
  6179.         'b' : BEGIN
  6180.             xsize := 640;
  6181.             ysize := 480;
  6182.         END;
  6183.         'c' : BEGIN
  6184.             xsize := 800;
  6185.             ysize := 600;
  6186.         END;
  6187.         'd' : BEGIN
  6188.             xsize := 1024;
  6189.             ysize := 768;
  6190.         END;
  6191.         'e' : BEGIN
  6192.             xsize := 1280;
  6193.             ysize := 1024;
  6194.         END;
  6195.     END;
  6196.     CASE choice1 OF
  6197.         '1' : mode := FindVesaMode(xsize,ysize,8);
  6198.         '2' : mode := FindVesaMode(xsize,ysize,15);
  6199.         '3' : mode := FindVesaMode(xsize,ysize,16);
  6200.         '4' : mode := FindVesaMode(xsize,ysize,24);
  6201.     END;
  6202.     IF mode = 0 THEN BEGIN
  6203.         WriteLn('No such mode could be found !');
  6204.         WriteLn('Switching to to 320x200.');
  6205.         ReadKey;
  6206.         mode := V320x200x256;
  6207.     END;
  6208. END;
  6209.  
  6210. begin { program body }
  6211.   SelectMode;
  6212.   Initialize;
  6213.   ReportStatus;
  6214.  
  6215. {  AspectRatioPlay; }
  6216.   FillEllipsePlay;
  6217.   SectorPlay;
  6218.   WriteModePlay;
  6219.  
  6220.   ColorPlay;
  6221.   { PalettePlay only intended to work on these drivers: }
  6222.   if (GraphDriver = EGA) or
  6223.       (GraphDriver = EGA64) or
  6224.       (GraphDriver = VGA) then
  6225.      PalettePlay;
  6226.   PutPixelPlay;
  6227. {  PutImagePlay; }
  6228.   RandBarPlay;
  6229.   BarPlay;
  6230.   Bar3DPlay;
  6231.   ArcPlay;
  6232.   CirclePlay;
  6233.   PiePlay;
  6234.   LineToPlay;
  6235.   LineRelPlay;
  6236. {  LineStylePlay; }
  6237. {  UserLineStylePlay; }
  6238.   TextDump;
  6239.   TextPlay;
  6240.   CrtModePlay;
  6241.   FillStylePlay;
  6242.   FillPatternPlay;
  6243.   PolyPlay;
  6244.   SayGoodbye;
  6245. {  CloseGraph; }
  6246.   CloseVesa;
  6247. end.
  6248. ***************************************************
  6249.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  6250.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  6251. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  6252. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  6253.     Color := RandColor;
  6254.     SetColor(Color);
  6255.     SetFillStyle(Random(CloseDotFill)+1, Color);
  6256.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  6257.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  6258.   until KeyPressed;
  6259.   WaitToGo;
  6260. end; { RandBarPlay }
  6261.  
  6262. procedure ArcPlay;
  6263. { Draw random arcs on the screen }
  6264. var
  6265.   MaxRadius : word;
  6266.   EndAngle : word;
  6267.   ArcInfo : ArcCoordsType;
  6268. begin
  6269.   MainWindow('Arc / GetArcCoords demonstration');
  6270.   StatusLine('Esc aborts or press a key');
  6271.   MaxRadius := MaxY div 10;
  6272.   repeat
  6273.     SetColor(RandColor);
  6274.     EndAngle := Random(360);
  6275.     SetLineStyle(SolidLn, 0, NormWidth);
  6276.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  6277.     GetArcCoords(ArcInfo);
  6278.     with ArcInfo do
  6279.     begin
  6280.       Line(X, Y, XStart, YStart);
  6281.       Line(X, Y, Xend, Yend);
  6282.     end;
  6283.   until KeyPressed;
  6284.   WaitToGo;
  6285. end; { ArcPlay }
  6286.  
  6287. procedure PutPixelPlay;
  6288. { Demonstrate the PutPixel and GetPixel commands }
  6289. const
  6290.   Seed   = 1962; { A seed for the random number generator }
  6291.   NumPts = 2000; { The number of pixels plotted }
  6292.   Esc    = #27;
  6293. var
  6294.   I : word;
  6295.   X, Y, Color : word;
  6296.   XMax, YMax  : integer;
  6297.   ViewInfo    : ViewPortType;
  6298. begin
  6299.   MainWindow('PutPixel / GetPixel demonstration');
  6300.   StatusLine('Esc aborts or press a key...');
  6301.  
  6302.   GetViewSettings(ViewInfo);
  6303.   with ViewInfo do
  6304.   begin
  6305.     XMax := (x2-x1-1);
  6306.     YMax := (y2-y1-1);
  6307.   end;
  6308.  
  6309.   while not KeyPressed do
  6310.   begin
  6311.     { Plot random pixels }
  6312.     RandSeed := Seed;
  6313.     I := 0;
  6314.     while (not KeyPressed) and (I < NumPts) do
  6315.     begin
  6316.       Inc(I);
  6317.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  6318.     end;
  6319.  
  6320.     { Erase pixels }
  6321.     RandSeed := Seed;
  6322.     I := 0;
  6323.     while (not KeyPressed) and (I < NumPts) do
  6324.     begin
  6325.       Inc(I);
  6326.       X := Random(XMax)+1;
  6327.       Y := Random(YMax)+1;
  6328.       Color := GetPixel(X, Y);
  6329.         if Color = RandColor then
  6330.           PutPixel(X, Y, 0);
  6331.      end;
  6332.   end;
  6333.   WaitToGo;
  6334. end; { PutPixelPlay }
  6335.  
  6336. procedure PutImagePlay;
  6337. { Demonstrate the GetImage and PutImage commands }
  6338.  
  6339. const
  6340.   r  = 20;
  6341.   StartX = 100;
  6342.   StartY = 50;
  6343.  
  6344. var
  6345.   CurPort : ViewPortType;
  6346.  
  6347. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  6348. var
  6349.   Step : integer;
  6350. begin
  6351.   Step := Random(2*r);
  6352.   if Odd(Step) then
  6353.     Step := -Step;
  6354.   X := X + Step;
  6355.   Step := Random(r);
  6356.   if Odd(Step) then
  6357.     Step := -Step;
  6358.   Y := Y + Step;
  6359.  
  6360.   { Make saucer bounce off viewport walls }
  6361.   with CurPort do
  6362.   begin
  6363.     if (x1 + X + Width - 1 > x2) then
  6364.       X := x2-x1 - Width + 1
  6365.     else
  6366.       if (X < 0) then
  6367.         X := 0;
  6368.     if (y1 + Y + Height - 1 > y2) then
  6369.       Y := y2-y1 - Height + 1
  6370.     else
  6371.       if (Y < 0) then
  6372.         Y := 0;
  6373.   end;
  6374. end; { MoveSaucer }
  6375.  
  6376. var
  6377.   Pausetime : word;
  6378.   Saucer    : pointer;
  6379.   X, Y      : integer;
  6380.   ulx, uly  : word;
  6381.   lrx, lry  : word;
  6382.   Size      : word;
  6383.   I         : word;
  6384. begin
  6385.   ClearDevice;
  6386.   FullPort;
  6387.  
  6388.   { PaintScreen }
  6389.   ClearDevice;
  6390.   MainWindow('GetImage / PutImage Demonstration');
  6391.   StatusLine('Esc aborts or press a key...');
  6392.   GetViewSettings(CurPort);
  6393.  
  6394.   { DrawSaucer }
  6395.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  6396.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  6397.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  6398.   Circle(StartX+10, StartY-12, 2);
  6399.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  6400.   Circle(StartX-10, StartY-12, 2);
  6401.   SetFillStyle(SolidFill, MaxColor);
  6402.   FloodFill(StartX+1, StartY+4, GetColor);
  6403.  
  6404.   { ReadSaucerImage }
  6405.   ulx := StartX-(r+1);
  6406.   uly := StartY-14;
  6407.   lrx := StartX+(r+1);
  6408.   lry := StartY+(r div 3)+3;
  6409.  
  6410.   Size := ImageSize(ulx, uly, lrx, lry);
  6411.   GetMem(Saucer, Size);
  6412.   GetImage(ulx, uly, lrx, lry, Saucer^);
  6413. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  6414.  
  6415.   { Plot some "stars" }
  6416.   for I := 1 to 1000 do
  6417.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  6418.   X := MaxX div 2;
  6419.   Y := MaxY div 2;
  6420.   PauseTime := 70;
  6421.  
  6422.   { Move the saucer around }
  6423.   repeat
  6424. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  6425.      Delay(PauseTime);
  6426. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  6427.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  6428.   until KeyPressed;
  6429.   FreeMem(Saucer, size);
  6430.   WaitToGo;
  6431. end; { PutImagePlay }
  6432.  
  6433. procedure PolyPlay;
  6434. { Draw random polygons with random fill styles on the screen }
  6435. const
  6436.   MaxPts = 5;
  6437. type
  6438.   PolygonType = array[1..MaxPts] of PointType;
  6439. var
  6440.   Poly : PolygonType;
  6441.   I, Color : word;
  6442. begin
  6443.   MainWindow('FillPoly demonstration');
  6444.   StatusLine('Esc aborts or press a key...');
  6445.   repeat
  6446.     Color := RandColor;
  6447.     SetFillStyle(Random(11)+1, Color);
  6448.     SetColor(Color);
  6449.     for I := 1 to MaxPts do
  6450.       with Poly[I] do
  6451.       begin
  6452.         X := Random(MaxX);
  6453.         Y := Random(MaxY);
  6454.       end;
  6455.     FillPoly(MaxPts, Poly);
  6456.   until KeyPressed;
  6457.   WaitToGo;
  6458. end; { PolyPlay }
  6459.  
  6460. procedure FillStylePlay;
  6461. { Display all of the predefined fill styles available }
  6462. var
  6463.   Style    : word;
  6464.   Width    : word;
  6465.   Height   : word;
  6466.   X, Y     : word;
  6467.   I, J     : word;
  6468.   ViewInfo : ViewPortType;
  6469.  
  6470. procedure DrawBox(X, Y : word);
  6471. begin
  6472.   SetFillStyle(Style, MaxColor);
  6473.   with ViewInfo do
  6474.     Bar(X, Y, X+Width, Y+Height);
  6475.   Rectangle(X, Y, X+Width, Y+Height);
  6476.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  6477.   Inc(Style);
  6478. end; { DrawBox }
  6479.  
  6480. begin
  6481.   MainWindow('Pre-defined fill styles');
  6482.   GetViewSettings(ViewInfo);
  6483.   with ViewInfo do
  6484.   begin
  6485.     Width := 2 * ((x2+1) div 13);
  6486.     Height := 2 * ((y2-10) div 10);
  6487.   end;
  6488.   X := Width div 2;
  6489.   Y := Height div 2;
  6490.   Style := 0;
  6491.   for J := 1 to 3 do
  6492.   begin
  6493.     for I := 1 to 4 do
  6494.     begin
  6495.       DrawBox(X, Y);
  6496.       Inc(X, (Width div 2) * 3);
  6497.     end;
  6498.     X := Width div 2;
  6499.     Inc(Y, (Height div 2) * 3);
  6500.   end;
  6501.   SetTextJustify(LeftText, TopText);
  6502.   WaitToGo;
  6503. end; { FillStylePlay }
  6504.  
  6505. procedure FillPatternPlay;
  6506. { Display some user defined fill patterns }
  6507. const
  6508.   Patterns : array[0..11] of FillPatternType = (
  6509.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  6510.             OldColor which has a path of pixels of OldColor or NewColor
  6511.             with sides touching back to the seed point, (XSeed, YSeed).
  6512.             Therefore, only pixels of OldColor are modified and no other
  6513.             information is changed.
  6514.  
  6515.             SEE ALSO
  6516.  
  6517.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  6518.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  6519.             SETVIEW
  6520.  
  6521.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  6522.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  6523.             IF WHICHVGA = 0 THEN STOP
  6524.             DUMMY=RES640
  6525.             SETVIEW 100, 100, 539, 379
  6526.             FILLVIEW 10
  6527.             WHILE INKEY$ = ""
  6528.             WEND
  6529.             VIDEOMODESET VMODE
  6530.             END
  6531.  
  6532.  
  6533.  
  6534.  
  6535.  
  6536.  
  6537.  
  6538.  
  6539.  
  6540.  
  6541.  
  6542.  
  6543.  
  6544.  
  6545.  
  6546.  
  6547.                                                                          63
  6548.  
  6549.  
  6550.  
  6551.  
  6552.  
  6553.           FONTGETINFO
  6554.  
  6555.             PROTOTYPE
  6556.  
  6557.             SUB FONTGETINFO (Width%, Height%)
  6558.  
  6559.             INPUT
  6560.  
  6561.             no input parameters
  6562.     WEND
  6563.             MOUSEEXIT
  6564.             VIDEOMODESET VMODE
  6565.             END
  6566.  
  6567.  
  6568.  
  6569.  
  6570.  
  6571.  
  6572.  
  6573.  
  6574.  
  6575.  
  6576.  
  6577.  
  6578.  
  6579.  
  6580.  
  6581.  
  6582.  
  6583.  
  6584.  
  6585.  
  6586.  
  6587.  
  6588.  
  6589.  
  6590.  
  6591.  
  6592.  
  6593.  
  6594.  
  6595.  
  6596.  
  6597.  
  6598.  
  6599.  
  6600.  
  6601.  
  6602.  
  6603.  
  6604.  
  6605.  
  6606.                                                                          86
  6607.  
  6608.  
  6609.  
  6610.  
  6611.  
  6612.           MOUSECURSORDEFAULT
  6613.  
  6614.             PROTOTYPE
  6615.  
  6616.             SUB MOUSECURSORDEFAULT ()
  6617.  
  6618.             INPUT
  6619.  
  6620.             no input parameters
  6621.  
  6622.             OUTPUT
  6623.  
  6624.             no value returned
  6625.  
  6626.             USAGE
  6627.  
  6628.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  6629.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  6630. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  6631. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  6632. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  6633. $╤
  6634. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  6635. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  6636. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  6637.       end;
  6638.     end;
  6639.   end;
  6640.   WaitToGo;
  6641. end; { UserLineStylePlay }
  6642.  
  6643.  
  6644. procedure SayGoodbye;
  6645. { Say goodbye and then exit the program }
  6646. var
  6647.   ViewInfo : ViewPortType;
  6648. begin
  6649.   MainWindow('');
  6650.   GetViewSettings(ViewInfo);
  6651.   SetTextStyle(TriplexFont, HorizDir, 4);
  6652.   SetTextJustify(CenterText, CenterText);
  6653.   with ViewInfo do
  6654.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  6655.   StatusLine('Press any key to quit...');
  6656.   repeat until KeyPressed;
  6657. end; { SayGoodbye }
  6658.  
  6659.  
  6660. PROCEDURE SelectMode;
  6661. VAR
  6662.     choice1,choice2     : CHAR;
  6663.    xsize,ysize            : WORD;
  6664. BEGIN
  6665.     (* Let's select a mode *)
  6666.     ClrScr;
  6667.     WriteLn('VESADEMO:');
  6668.     WriteLn('1. 256 colors');
  6669.     WriteLn('2. 32768 colors');
  6670.     WriteLn('3. 65536 colors');
  6671.     WriteLn('4. 16777216 colors');
  6672.     WriteLn('Q uit');
  6673.     WriteLn;
  6674.     Write('Your choice: ');
  6675.     REPEAT
  6676.         ReadLn(choice1);
  6677.       IF choice1 <> '1' THEN BEGIN
  6678.           WriteLn('Sorry !');
  6679.          WriteLn('This demo wasn''t written for more as 256 colors !');
  6680.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  6681.          WriteLn('Switching to 256 colors.');
  6682.          choice1 := '1';
  6683.       END;
  6684.     UNTIL choice1 IN ['1'..'4','q'];
  6685.     IF choice1 = 'q' THEN Halt;
  6686.  
  6687.     WriteLn;
  6688.     WriteLn;
  6689.     WriteLn('a. 320x200');
  6690.     WriteLn('b. 640x480');
  6691.     WriteLn('c. 800x600');
  6692.     WriteLn('d. 1024x768');
  6693.     WriteLn('e. 1280x1024');
  6694.     WriteLn('Q uit');
  6695.     WriteLn;
  6696.     Write('Your choice: ');
  6697.     REPEAT
  6698.         ReadLn(choice2);
  6699.     UNTIL choice2 IN ['a'..'e','q'];
  6700.     IF choice2 = 'q' THEN Halt;
  6701.  
  6702.     CASE choice2 OF
  6703.         'a' : BEGIN
  6704.             xsize := 320;
  6705.             ysize := 200;
  6706.         END;
  6707.         'b' : BEGIN
  6708.             xsize := 640;
  6709.             ysize := 480;
  6710.         END;
  6711.         'c' : BEGIN
  6712.             xsize := 800;
  6713.             ysize := 600;
  6714.         END;
  6715.         'd' : BEGIN
  6716.             xsize := 1024;
  6717.             ysize := 768;
  6718.         END;
  6719.         'e' : BEGIN
  6720.             xsize := 1280;
  6721.             ysize := 1024;
  6722.         END;
  6723.     END;
  6724.     CASE choice1 OF
  6725.         '1' : mode := FindVesaMode(xsize,ysize,8);
  6726.         '2' : mode := FindVesaMode(xsize,ysize,15);
  6727.         '3' : mode := FindVesaMode(xsize,ysize,16);
  6728.         '4' : mode := FindVesaMode(xsize,ysize,24);
  6729.     END;
  6730.     IF mode = 0 THEN BEGIN
  6731.         WriteLn('No such mode could be found !');
  6732.         WriteLn('Switching to to 320x200.');
  6733.         ReadKey;
  6734.         mode := V320x200x256;
  6735.     END;
  6736. END;
  6737.  
  6738. begin { program body }
  6739.   SelectMode;
  6740.   Initialize;
  6741.   ReportStatus;
  6742.  
  6743. {  AspectRatioPlay; }
  6744.   FillEllipsePlay;
  6745.   SectorPlay;
  6746.   WriteModePlay;
  6747.  
  6748.   ColorPlay;
  6749.   { PalettePlay only intended to work on these drivers: }
  6750.   if (GraphDriver = EGA) or
  6751.       (GraphDriver = EGA64) or
  6752.       (GraphDriver = VGA) then
  6753.      PalettePlay;
  6754.   PutPixelPlay;
  6755. {  PutImagePlay; }
  6756.   RandBarPlay;
  6757.   BarPlay;
  6758.   Bar3DPlay;
  6759.   ArcPlay;
  6760.   CirclePlay;
  6761.   PiePlay;
  6762.   LineToPlay;
  6763.   LineRelPlay;
  6764. {  LineStylePlay; }
  6765. {  UserLineStylePlay; }
  6766.   TextDump;
  6767.   TextPlay;
  6768.   CrtModePlay;
  6769.   FillStylePlay;
  6770.   FillPatternPlay;
  6771.   PolyPlay;
  6772.   SayGoodbye;
  6773. {  CloseGraph; }
  6774.   CloseVesa;
  6775. end.
  6776. ***************************************************
  6777.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  6778.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  6779. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  6780. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  6781.     Color := RandColor;
  6782.     SetColor(Color);
  6783.     SetFillStyle(Random(CloseDotFill)+1, Color);
  6784.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  6785.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  6786.   until KeyPressed;
  6787.   WaitToGo;
  6788. end; { RandBarPlay }
  6789.  
  6790. procedure ArcPlay;
  6791. { Draw random arcs on the screen }
  6792. var
  6793.   MaxRadius : word;
  6794.   EndAngle : word;
  6795.   ArcInfo : ArcCoordsType;
  6796. begin
  6797.   MainWindow('Arc / GetArcCoords demonstration');
  6798.   StatusLine('Esc aborts or press a key');
  6799.   MaxRadius := MaxY div 10;
  6800.   repeat
  6801.     SetColor(RandColor);
  6802.     EndAngle := Random(360);
  6803.     SetLineStyle(SolidLn, 0, NormWidth);
  6804.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  6805.     GetArcCoords(ArcInfo);
  6806.     with ArcInfo do
  6807.     begin
  6808.       Line(X, Y, XStart, YStart);
  6809.       Line(X, Y, Xend, Yend);
  6810.     end;
  6811.   until KeyPressed;
  6812.   WaitToGo;
  6813. end; { ArcPlay }
  6814.  
  6815. procedure PutPixelPlay;
  6816. { Demonstrate the PutPixel and GetPixel commands }
  6817. const
  6818.   Seed   = 1962; { A seed for the random number generator }
  6819.   NumPts = 2000; { The number of pixels plotted }
  6820.   Esc    = #27;
  6821. var
  6822.   I : word;
  6823.   X, Y, Color : word;
  6824.   XMax, YMax  : integer;
  6825.   ViewInfo    : ViewPortType;
  6826. begin
  6827.   MainWindow('PutPixel / GetPixel demonstration');
  6828.   StatusLine('Esc aborts or press a key...');
  6829.  
  6830.   GetViewSettings(ViewInfo);
  6831.   with ViewInfo do
  6832.   begin
  6833.     XMax := (x2-x1-1);
  6834.     YMax := (y2-y1-1);
  6835.   end;
  6836.  
  6837.   while not KeyPressed do
  6838.   begin
  6839.     { Plot random pixels }
  6840.     RandSeed := Seed;
  6841.     I := 0;
  6842.     while (not KeyPressed) and (I < NumPts) do
  6843.     begin
  6844.       Inc(I);
  6845.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  6846.     end;
  6847.  
  6848.     { Erase pixels }
  6849.     RandSeed := Seed;
  6850.     I := 0;
  6851.     while (not KeyPressed) and (I < NumPts) do
  6852.     begin
  6853.       Inc(I);
  6854.       X := Random(XMax)+1;
  6855.       Y := Random(YMax)+1;
  6856.       Color := GetPixel(X, Y);
  6857.         if Color = RandColor then
  6858.           PutPixel(X, Y, 0);
  6859.      end;
  6860.   end;
  6861.   WaitToGo;
  6862. end; { PutPixelPlay }
  6863.  
  6864. procedure PutImagePlay;
  6865. { Demonstrate the GetImage and PutImage commands }
  6866.  
  6867. const
  6868.   r  = 20;
  6869.   StartX = 100;
  6870.   StartY = 50;
  6871.  
  6872. var
  6873.   CurPort : ViewPortType;
  6874.  
  6875. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  6876. var
  6877.   Step : integer;
  6878. begin
  6879.   Step := Random(2*r);
  6880.   if Odd(Step) then
  6881.     Step := -Step;
  6882.   X := X + Step;
  6883.   Step := Random(r);
  6884.   if Odd(Step) then
  6885.     Step := -Step;
  6886.   Y := Y + Step;
  6887.  
  6888.   { Make saucer bounce off viewport walls }
  6889.   with CurPort do
  6890.   begin
  6891.     if (x1 + X + Width - 1 > x2) then
  6892.       X := x2-x1 - Width + 1
  6893.     else
  6894.       if (X < 0) then
  6895.         X := 0;
  6896.     if (y1 + Y + Height - 1 > y2) then
  6897.       Y := y2-y1 - Height + 1
  6898.     else
  6899.       if (Y < 0) then
  6900.         Y := 0;
  6901.   end;
  6902. end; { MoveSaucer }
  6903.  
  6904. var
  6905.   Pausetime : word;
  6906.   Saucer    : pointer;
  6907.   X, Y      : integer;
  6908.   ulx, uly  : word;
  6909.   lrx, lry  : word;
  6910.   Size      : word;
  6911.   I         : word;
  6912. begin
  6913.   ClearDevice;
  6914.   FullPort;
  6915.  
  6916.   { PaintScreen }
  6917.   ClearDevice;
  6918.   MainWindow('GetImage / PutImage Demonstration');
  6919.   StatusLine('Esc aborts or press a key...');
  6920.   GetViewSettings(CurPort);
  6921.  
  6922.   { DrawSaucer }
  6923.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  6924.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  6925.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  6926.   Circle(StartX+10, StartY-12, 2);
  6927.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  6928.   Circle(StartX-10, StartY-12, 2);
  6929.   SetFillStyle(SolidFill, MaxColor);
  6930.   FloodFill(StartX+1, StartY+4, GetColor);
  6931.  
  6932.   { ReadSaucerImage }
  6933.   ulx := StartX-(r+1);
  6934.   uly := StartY-14;
  6935.   lrx := StartX+(r+1);
  6936.   lry := StartY+(r div 3)+3;
  6937.  
  6938.   Size := ImageSize(ulx, uly, lrx, lry);
  6939.   GetMem(Saucer, Size);
  6940.   GetImage(ulx, uly, lrx, lry, Saucer^);
  6941. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  6942.  
  6943.   { Plot some "stars" }
  6944.   for I := 1 to 1000 do
  6945.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  6946.   X := MaxX div 2;
  6947.   Y := MaxY div 2;
  6948.   PauseTime := 70;
  6949.  
  6950.   { Move the saucer around }
  6951.   repeat
  6952. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  6953.      Delay(PauseTime);
  6954. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  6955.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  6956.   until KeyPressed;
  6957.   FreeMem(Saucer, size);
  6958.   WaitToGo;
  6959. end; { PutImagePlay }
  6960.  
  6961. procedure PolyPlay;
  6962. { Draw random polygons with random fill styles on the screen }
  6963. const
  6964.   MaxPts = 5;
  6965. type
  6966.   PolygonType = array[1..MaxPts] of PointType;
  6967. var
  6968.   Poly : PolygonType;
  6969.   I, Color : word;
  6970. begin
  6971.   MainWindow('FillPoly demonstration');
  6972.   StatusLine('Esc aborts or press a key...');
  6973.   repeat
  6974.     Color := RandColor;
  6975.     SetFillStyle(Random(11)+1, Color);
  6976.     SetColor(Color);
  6977.     for I := 1 to MaxPts do
  6978.       with Poly[I] do
  6979.       begin
  6980.         X := Random(MaxX);
  6981.         Y := Random(MaxY);
  6982.       end;
  6983.     FillPoly(MaxPts, Poly);
  6984.   until KeyPressed;
  6985.   WaitToGo;
  6986. end; { PolyPlay }
  6987.  
  6988. procedure FillStylePlay;
  6989. { Display all of the predefined fill styles available }
  6990. var
  6991.   Style    : word;
  6992.   Width    : word;
  6993.   Height   : word;
  6994.   X, Y     : word;
  6995.   I, J     : word;
  6996.   ViewInfo : ViewPortType;
  6997.  
  6998. procedure DrawBox(X, Y : word);
  6999. begin
  7000.   SetFillStyle(Style, MaxColor);
  7001.   with ViewInfo do
  7002.     Bar(X, Y, X+Width, Y+Height);
  7003.   Rectangle(X, Y, X+Width, Y+Height);
  7004.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  7005.   Inc(Style);
  7006. end; { DrawBox }
  7007.  
  7008. begin
  7009.   MainWindow('Pre-defined fill styles');
  7010.   GetViewSettings(ViewInfo);
  7011.   with ViewInfo do
  7012.   begin
  7013.     Width := 2 * ((x2+1) div 13);
  7014.     Height := 2 * ((y2-10) div 10);
  7015.   end;
  7016.   X := Width div 2;
  7017.   Y := Height div 2;
  7018.   Style := 0;
  7019.   for J := 1 to 3 do
  7020.   begin
  7021.     for I := 1 to 4 do
  7022.     begin
  7023.       DrawBox(X, Y);
  7024.       Inc(X, (Width div 2) * 3);
  7025.     end;
  7026.     X := Width div 2;
  7027.     Inc(Y, (Height div 2) * 3);
  7028.   end;
  7029.   SetTextJustify(LeftText, TopText);
  7030.   WaitToGo;
  7031. end; { FillStylePlay }
  7032.  
  7033. procedure FillPatternPlay;
  7034. { Display some user defined fill patterns }
  7035. const
  7036.   Patterns : array[0..11] of FillPatternType = (
  7037.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  7038.             OldColor which has a path of pixels of OldColor or NewColor
  7039.             with sides touching back to the seed point, (XSeed, YSeed).
  7040.             Therefore, only pixels of OldColor are modified and no other
  7041.             information is changed.
  7042.  
  7043.             SEE ALSO
  7044.  
  7045.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  7046.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  7047.             SETVIEW
  7048.  
  7049.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  7050.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  7051.             IF WHICHVGA = 0 THEN STOP
  7052.             DUMMY=RES640
  7053.             SETVIEW 100, 100, 539, 379
  7054.             FILLVIEW 10
  7055.             WHILE INKEY$ = ""
  7056.             WEND
  7057.             VIDEOMODESET VMODE
  7058.             END
  7059.  
  7060.  
  7061.  
  7062.  
  7063.  
  7064.  
  7065.  
  7066.  
  7067.  
  7068.  
  7069.  
  7070.  
  7071.  
  7072.  
  7073.  
  7074.  
  7075.                                                                          63
  7076.  
  7077.  
  7078.  
  7079.  
  7080.  
  7081.           FONTGETINFO
  7082.  
  7083.             PROTOTYPE
  7084.  
  7085.             SUB FONTGETINFO (Width%, Height%)
  7086.  
  7087.             INPUT
  7088.  
  7089.             no input parameters
  7090.     WEND
  7091.             MOUSEEXIT
  7092.             VIDEOMODESET VMODE
  7093.             END
  7094.  
  7095.  
  7096.  
  7097.  
  7098.  
  7099.  
  7100.  
  7101.  
  7102.  
  7103.  
  7104.  
  7105.  
  7106.  
  7107.  
  7108.  
  7109.  
  7110.  
  7111.  
  7112.  
  7113.  
  7114.  
  7115.  
  7116.  
  7117.  
  7118.  
  7119.  
  7120.  
  7121.  
  7122.  
  7123.  
  7124.  
  7125.  
  7126.  
  7127.  
  7128.  
  7129.  
  7130.  
  7131.  
  7132.  
  7133.  
  7134.                                                                          86
  7135.  
  7136.  
  7137.  
  7138.  
  7139.  
  7140.           MOUSECURSORDEFAULT
  7141.  
  7142.             PROTOTYPE
  7143.  
  7144.             SUB MOUSECURSORDEFAULT ()
  7145.  
  7146.             INPUT
  7147.  
  7148.             no input parameters
  7149.  
  7150.             OUTPUT
  7151.  
  7152.             no value returned
  7153.  
  7154.             USAGE
  7155.  
  7156.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  7157.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  7158. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  7159. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  7160. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  7161. $╤
  7162. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  7163. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  7164. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  7165.       end;
  7166.     end;
  7167.   end;
  7168.   WaitToGo;
  7169. end; { UserLineStylePlay }
  7170.  
  7171.  
  7172. procedure SayGoodbye;
  7173. { Say goodbye and then exit the program }
  7174. var
  7175.   ViewInfo : ViewPortType;
  7176. begin
  7177.   MainWindow('');
  7178.   GetViewSettings(ViewInfo);
  7179.   SetTextStyle(TriplexFont, HorizDir, 4);
  7180.   SetTextJustify(CenterText, CenterText);
  7181.   with ViewInfo do
  7182.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  7183.   StatusLine('Press any key to quit...');
  7184.   repeat until KeyPressed;
  7185. end; { SayGoodbye }
  7186.  
  7187.  
  7188. PROCEDURE SelectMode;
  7189. VAR
  7190.     choice1,choice2     : CHAR;
  7191.    xsize,ysize            : WORD;
  7192. BEGIN
  7193.     (* Let's select a mode *)
  7194.     ClrScr;
  7195.     WriteLn('VESADEMO:');
  7196.     WriteLn('1. 256 colors');
  7197.     WriteLn('2. 32768 colors');
  7198.     WriteLn('3. 65536 colors');
  7199.     WriteLn('4. 16777216 colors');
  7200.     WriteLn('Q uit');
  7201.     WriteLn;
  7202.     Write('Your choice: ');
  7203.     REPEAT
  7204.         ReadLn(choice1);
  7205.       IF choice1 <> '1' THEN BEGIN
  7206.           WriteLn('Sorry !');
  7207.          WriteLn('This demo wasn''t written for more as 256 colors !');
  7208.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  7209.          WriteLn('Switching to 256 colors.');
  7210.          choice1 := '1';
  7211.       END;
  7212.     UNTIL choice1 IN ['1'..'4','q'];
  7213.     IF choice1 = 'q' THEN Halt;
  7214.  
  7215.     WriteLn;
  7216.     WriteLn;
  7217.     WriteLn('a. 320x200');
  7218.     WriteLn('b. 640x480');
  7219.     WriteLn('c. 800x600');
  7220.     WriteLn('d. 1024x768');
  7221.     WriteLn('e. 1280x1024');
  7222.     WriteLn('Q uit');
  7223.     WriteLn;
  7224.     Write('Your choice: ');
  7225.     REPEAT
  7226.         ReadLn(choice2);
  7227.     UNTIL choice2 IN ['a'..'e','q'];
  7228.     IF choice2 = 'q' THEN Halt;
  7229.  
  7230.     CASE choice2 OF
  7231.         'a' : BEGIN
  7232.             xsize := 320;
  7233.             ysize := 200;
  7234.         END;
  7235.         'b' : BEGIN
  7236.             xsize := 640;
  7237.             ysize := 480;
  7238.         END;
  7239.         'c' : BEGIN
  7240.             xsize := 800;
  7241.             ysize := 600;
  7242.         END;
  7243.         'd' : BEGIN
  7244.             xsize := 1024;
  7245.             ysize := 768;
  7246.         END;
  7247.         'e' : BEGIN
  7248.             xsize := 1280;
  7249.             ysize := 1024;
  7250.         END;
  7251.     END;
  7252.     CASE choice1 OF
  7253.         '1' : mode := FindVesaMode(xsize,ysize,8);
  7254.         '2' : mode := FindVesaMode(xsize,ysize,15);
  7255.         '3' : mode := FindVesaMode(xsize,ysize,16);
  7256.         '4' : mode := FindVesaMode(xsize,ysize,24);
  7257.     END;
  7258.     IF mode = 0 THEN BEGIN
  7259.         WriteLn('No such mode could be found !');
  7260.         WriteLn('Switching to to 320x200.');
  7261.         ReadKey;
  7262.         mode := V320x200x256;
  7263.     END;
  7264. END;
  7265.  
  7266. begin { program body }
  7267.   SelectMode;
  7268.   Initialize;
  7269.   ReportStatus;
  7270.  
  7271. {  AspectRatioPlay; }
  7272.   FillEllipsePlay;
  7273.   SectorPlay;
  7274.   WriteModePlay;
  7275.  
  7276.   ColorPlay;
  7277.   { PalettePlay only intended to work on these drivers: }
  7278.   if (GraphDriver = EGA) or
  7279.       (GraphDriver = EGA64) or
  7280.       (GraphDriver = VGA) then
  7281.      PalettePlay;
  7282.   PutPixelPlay;
  7283. {  PutImagePlay; }
  7284.   RandBarPlay;
  7285.   BarPlay;
  7286.   Bar3DPlay;
  7287.   ArcPlay;
  7288.   CirclePlay;
  7289.   PiePlay;
  7290.   LineToPlay;
  7291.   LineRelPlay;
  7292. {  LineStylePlay; }
  7293. {  UserLineStylePlay; }
  7294.   TextDump;
  7295.   TextPlay;
  7296.   CrtModePlay;
  7297.   FillStylePlay;
  7298.   FillPatternPlay;
  7299.   PolyPlay;
  7300.   SayGoodbye;
  7301. {  CloseGraph; }
  7302.   CloseVesa;
  7303. end.
  7304. ***************************************************
  7305.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  7306.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  7307. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  7308. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  7309.     Color := RandColor;
  7310.     SetColor(Color);
  7311.     SetFillStyle(Random(CloseDotFill)+1, Color);
  7312.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  7313.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  7314.   until KeyPressed;
  7315.   WaitToGo;
  7316. end; { RandBarPlay }
  7317.  
  7318. procedure ArcPlay;
  7319. { Draw random arcs on the screen }
  7320. var
  7321.   MaxRadius : word;
  7322.   EndAngle : word;
  7323.   ArcInfo : ArcCoordsType;
  7324. begin
  7325.   MainWindow('Arc / GetArcCoords demonstration');
  7326.   StatusLine('Esc aborts or press a key');
  7327.   MaxRadius := MaxY div 10;
  7328.   repeat
  7329.     SetColor(RandColor);
  7330.     EndAngle := Random(360);
  7331.     SetLineStyle(SolidLn, 0, NormWidth);
  7332.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  7333.     GetArcCoords(ArcInfo);
  7334.     with ArcInfo do
  7335.     begin
  7336.       Line(X, Y, XStart, YStart);
  7337.       Line(X, Y, Xend, Yend);
  7338.     end;
  7339.   until KeyPressed;
  7340.   WaitToGo;
  7341. end; { ArcPlay }
  7342.  
  7343. procedure PutPixelPlay;
  7344. { Demonstrate the PutPixel and GetPixel commands }
  7345. const
  7346.   Seed   = 1962; { A seed for the random number generator }
  7347.   NumPts = 2000; { The number of pixels plotted }
  7348.   Esc    = #27;
  7349. var
  7350.   I : word;
  7351.   X, Y, Color : word;
  7352.   XMax, YMax  : integer;
  7353.   ViewInfo    : ViewPortType;
  7354. begin
  7355.   MainWindow('PutPixel / GetPixel demonstration');
  7356.   StatusLine('Esc aborts or press a key...');
  7357.  
  7358.   GetViewSettings(ViewInfo);
  7359.   with ViewInfo do
  7360.   begin
  7361.     XMax := (x2-x1-1);
  7362.     YMax := (y2-y1-1);
  7363.   end;
  7364.  
  7365.   while not KeyPressed do
  7366.   begin
  7367.     { Plot random pixels }
  7368.     RandSeed := Seed;
  7369.     I := 0;
  7370.     while (not KeyPressed) and (I < NumPts) do
  7371.     begin
  7372.       Inc(I);
  7373.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  7374.     end;
  7375.  
  7376.     { Erase pixels }
  7377.     RandSeed := Seed;
  7378.     I := 0;
  7379.     while (not KeyPressed) and (I < NumPts) do
  7380.     begin
  7381.       Inc(I);
  7382.       X := Random(XMax)+1;
  7383.       Y := Random(YMax)+1;
  7384.       Color := GetPixel(X, Y);
  7385.         if Color = RandColor then
  7386.           PutPixel(X, Y, 0);
  7387.      end;
  7388.   end;
  7389.   WaitToGo;
  7390. end; { PutPixelPlay }
  7391.  
  7392. procedure PutImagePlay;
  7393. { Demonstrate the GetImage and PutImage commands }
  7394.  
  7395. const
  7396.   r  = 20;
  7397.   StartX = 100;
  7398.   StartY = 50;
  7399.  
  7400. var
  7401.   CurPort : ViewPortType;
  7402.  
  7403. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  7404. var
  7405.   Step : integer;
  7406. begin
  7407.   Step := Random(2*r);
  7408.   if Odd(Step) then
  7409.     Step := -Step;
  7410.   X := X + Step;
  7411.   Step := Random(r);
  7412.   if Odd(Step) then
  7413.     Step := -Step;
  7414.   Y := Y + Step;
  7415.  
  7416.   { Make saucer bounce off viewport walls }
  7417.   with CurPort do
  7418.   begin
  7419.     if (x1 + X + Width - 1 > x2) then
  7420.       X := x2-x1 - Width + 1
  7421.     else
  7422.       if (X < 0) then
  7423.         X := 0;
  7424.     if (y1 + Y + Height - 1 > y2) then
  7425.       Y := y2-y1 - Height + 1
  7426.     else
  7427.       if (Y < 0) then
  7428.         Y := 0;
  7429.   end;
  7430. end; { MoveSaucer }
  7431.  
  7432. var
  7433.   Pausetime : word;
  7434.   Saucer    : pointer;
  7435.   X, Y      : integer;
  7436.   ulx, uly  : word;
  7437.   lrx, lry  : word;
  7438.   Size      : word;
  7439.   I         : word;
  7440. begin
  7441.   ClearDevice;
  7442.   FullPort;
  7443.  
  7444.   { PaintScreen }
  7445.   ClearDevice;
  7446.   MainWindow('GetImage / PutImage Demonstration');
  7447.   StatusLine('Esc aborts or press a key...');
  7448.   GetViewSettings(CurPort);
  7449.  
  7450.   { DrawSaucer }
  7451.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  7452.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  7453.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  7454.   Circle(StartX+10, StartY-12, 2);
  7455.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  7456.   Circle(StartX-10, StartY-12, 2);
  7457.   SetFillStyle(SolidFill, MaxColor);
  7458.   FloodFill(StartX+1, StartY+4, GetColor);
  7459.  
  7460.   { ReadSaucerImage }
  7461.   ulx := StartX-(r+1);
  7462.   uly := StartY-14;
  7463.   lrx := StartX+(r+1);
  7464.   lry := StartY+(r div 3)+3;
  7465.  
  7466.   Size := ImageSize(ulx, uly, lrx, lry);
  7467.   GetMem(Saucer, Size);
  7468.   GetImage(ulx, uly, lrx, lry, Saucer^);
  7469. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  7470.  
  7471.   { Plot some "stars" }
  7472.   for I := 1 to 1000 do
  7473.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  7474.   X := MaxX div 2;
  7475.   Y := MaxY div 2;
  7476.   PauseTime := 70;
  7477.  
  7478.   { Move the saucer around }
  7479.   repeat
  7480. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  7481.      Delay(PauseTime);
  7482. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  7483.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  7484.   until KeyPressed;
  7485.   FreeMem(Saucer, size);
  7486.   WaitToGo;
  7487. end; { PutImagePlay }
  7488.  
  7489. procedure PolyPlay;
  7490. { Draw random polygons with random fill styles on the screen }
  7491. const
  7492.   MaxPts = 5;
  7493. type
  7494.   PolygonType = array[1..MaxPts] of PointType;
  7495. var
  7496.   Poly : PolygonType;
  7497.   I, Color : word;
  7498. begin
  7499.   MainWindow('FillPoly demonstration');
  7500.   StatusLine('Esc aborts or press a key...');
  7501.   repeat
  7502.     Color := RandColor;
  7503.     SetFillStyle(Random(11)+1, Color);
  7504.     SetColor(Color);
  7505.     for I := 1 to MaxPts do
  7506.       with Poly[I] do
  7507.       begin
  7508.         X := Random(MaxX);
  7509.         Y := Random(MaxY);
  7510.       end;
  7511.     FillPoly(MaxPts, Poly);
  7512.   until KeyPressed;
  7513.   WaitToGo;
  7514. end; { PolyPlay }
  7515.  
  7516. procedure FillStylePlay;
  7517. { Display all of the predefined fill styles available }
  7518. var
  7519.   Style    : word;
  7520.   Width    : word;
  7521.   Height   : word;
  7522.   X, Y     : word;
  7523.   I, J     : word;
  7524.   ViewInfo : ViewPortType;
  7525.  
  7526. procedure DrawBox(X, Y : word);
  7527. begin
  7528.   SetFillStyle(Style, MaxColor);
  7529.   with ViewInfo do
  7530.     Bar(X, Y, X+Width, Y+Height);
  7531.   Rectangle(X, Y, X+Width, Y+Height);
  7532.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  7533.   Inc(Style);
  7534. end; { DrawBox }
  7535.  
  7536. begin
  7537.   MainWindow('Pre-defined fill styles');
  7538.   GetViewSettings(ViewInfo);
  7539.   with ViewInfo do
  7540.   begin
  7541.     Width := 2 * ((x2+1) div 13);
  7542.     Height := 2 * ((y2-10) div 10);
  7543.   end;
  7544.   X := Width div 2;
  7545.   Y := Height div 2;
  7546.   Style := 0;
  7547.   for J := 1 to 3 do
  7548.   begin
  7549.     for I := 1 to 4 do
  7550.     begin
  7551.       DrawBox(X, Y);
  7552.       Inc(X, (Width div 2) * 3);
  7553.     end;
  7554.     X := Width div 2;
  7555.     Inc(Y, (Height div 2) * 3);
  7556.   end;
  7557.   SetTextJustify(LeftText, TopText);
  7558.   WaitToGo;
  7559. end; { FillStylePlay }
  7560.  
  7561. procedure FillPatternPlay;
  7562. { Display some user defined fill patterns }
  7563. const
  7564.   Patterns : array[0..11] of FillPatternType = (
  7565.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  7566.             OldColor which has a path of pixels of OldColor or NewColor
  7567.             with sides touching back to the seed point, (XSeed, YSeed).
  7568.             Therefore, only pixels of OldColor are modified and no other
  7569.             information is changed.
  7570.  
  7571.             SEE ALSO
  7572.  
  7573.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  7574.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  7575.             SETVIEW
  7576.  
  7577.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  7578.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  7579.             IF WHICHVGA = 0 THEN STOP
  7580.             DUMMY=RES640
  7581.             SETVIEW 100, 100, 539, 379
  7582.             FILLVIEW 10
  7583.             WHILE INKEY$ = ""
  7584.             WEND
  7585.             VIDEOMODESET VMODE
  7586.             END
  7587.  
  7588.  
  7589.  
  7590.  
  7591.  
  7592.  
  7593.  
  7594.  
  7595.  
  7596.  
  7597.  
  7598.  
  7599.  
  7600.  
  7601.  
  7602.  
  7603.                                                                          63
  7604.  
  7605.  
  7606.  
  7607.  
  7608.  
  7609.           FONTGETINFO
  7610.  
  7611.             PROTOTYPE
  7612.  
  7613.             SUB FONTGETINFO (Width%, Height%)
  7614.  
  7615.             INPUT
  7616.  
  7617.             no input parameters
  7618.     WEND
  7619.             MOUSEEXIT
  7620.             VIDEOMODESET VMODE
  7621.             END
  7622.  
  7623.  
  7624.  
  7625.  
  7626.  
  7627.  
  7628.  
  7629.  
  7630.  
  7631.  
  7632.  
  7633.  
  7634.  
  7635.  
  7636.  
  7637.  
  7638.  
  7639.  
  7640.  
  7641.  
  7642.  
  7643.  
  7644.  
  7645.  
  7646.  
  7647.  
  7648.  
  7649.  
  7650.  
  7651.  
  7652.  
  7653.  
  7654.  
  7655.  
  7656.  
  7657.  
  7658.  
  7659.  
  7660.  
  7661.  
  7662.                                                                          86
  7663.  
  7664.  
  7665.  
  7666.  
  7667.  
  7668.           MOUSECURSORDEFAULT
  7669.  
  7670.             PROTOTYPE
  7671.  
  7672.             SUB MOUSECURSORDEFAULT ()
  7673.  
  7674.             INPUT
  7675.  
  7676.             no input parameters
  7677.  
  7678.             OUTPUT
  7679.  
  7680.             no value returned
  7681.  
  7682.             USAGE
  7683.  
  7684.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  7685.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  7686. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  7687. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  7688. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  7689. $╤
  7690. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  7691. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  7692. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  7693.       end;
  7694.     end;
  7695.   end;
  7696.   WaitToGo;
  7697. end; { UserLineStylePlay }
  7698.  
  7699.  
  7700. procedure SayGoodbye;
  7701. { Say goodbye and then exit the program }
  7702. var
  7703.   ViewInfo : ViewPortType;
  7704. begin
  7705.   MainWindow('');
  7706.   GetViewSettings(ViewInfo);
  7707.   SetTextStyle(TriplexFont, HorizDir, 4);
  7708.   SetTextJustify(CenterText, CenterText);
  7709.   with ViewInfo do
  7710.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  7711.   StatusLine('Press any key to quit...');
  7712.   repeat until KeyPressed;
  7713. end; { SayGoodbye }
  7714.  
  7715.  
  7716. PROCEDURE SelectMode;
  7717. VAR
  7718.     choice1,choice2     : CHAR;
  7719.    xsize,ysize            : WORD;
  7720. BEGIN
  7721.     (* Let's select a mode *)
  7722.     ClrScr;
  7723.     WriteLn('VESADEMO:');
  7724.     WriteLn('1. 256 colors');
  7725.     WriteLn('2. 32768 colors');
  7726.     WriteLn('3. 65536 colors');
  7727.     WriteLn('4. 16777216 colors');
  7728.     WriteLn('Q uit');
  7729.     WriteLn;
  7730.     Write('Your choice: ');
  7731.     REPEAT
  7732.         ReadLn(choice1);
  7733.       IF choice1 <> '1' THEN BEGIN
  7734.           WriteLn('Sorry !');
  7735.          WriteLn('This demo wasn''t written for more as 256 colors !');
  7736.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  7737.          WriteLn('Switching to 256 colors.');
  7738.          choice1 := '1';
  7739.       END;
  7740.     UNTIL choice1 IN ['1'..'4','q'];
  7741.     IF choice1 = 'q' THEN Halt;
  7742.  
  7743.     WriteLn;
  7744.     WriteLn;
  7745.     WriteLn('a. 320x200');
  7746.     WriteLn('b. 640x480');
  7747.     WriteLn('c. 800x600');
  7748.     WriteLn('d. 1024x768');
  7749.     WriteLn('e. 1280x1024');
  7750.     WriteLn('Q uit');
  7751.     WriteLn;
  7752.     Write('Your choice: ');
  7753.     REPEAT
  7754.         ReadLn(choice2);
  7755.     UNTIL choice2 IN ['a'..'e','q'];
  7756.     IF choice2 = 'q' THEN Halt;
  7757.  
  7758.     CASE choice2 OF
  7759.         'a' : BEGIN
  7760.             xsize := 320;
  7761.             ysize := 200;
  7762.         END;
  7763.         'b' : BEGIN
  7764.             xsize := 640;
  7765.             ysize := 480;
  7766.         END;
  7767.         'c' : BEGIN
  7768.             xsize := 800;
  7769.             ysize := 600;
  7770.         END;
  7771.         'd' : BEGIN
  7772.             xsize := 1024;
  7773.             ysize := 768;
  7774.         END;
  7775.         'e' : BEGIN
  7776.             xsize := 1280;
  7777.             ysize := 1024;
  7778.         END;
  7779.     END;
  7780.     CASE choice1 OF
  7781.         '1' : mode := FindVesaMode(xsize,ysize,8);
  7782.         '2' : mode := FindVesaMode(xsize,ysize,15);
  7783.         '3' : mode := FindVesaMode(xsize,ysize,16);
  7784.         '4' : mode := FindVesaMode(xsize,ysize,24);
  7785.     END;
  7786.     IF mode = 0 THEN BEGIN
  7787.         WriteLn('No such mode could be found !');
  7788.         WriteLn('Switching to to 320x200.');
  7789.         ReadKey;
  7790.         mode := V320x200x256;
  7791.     END;
  7792. END;
  7793.  
  7794. begin { program body }
  7795.   SelectMode;
  7796.   Initialize;
  7797.   ReportStatus;
  7798.  
  7799. {  AspectRatioPlay; }
  7800.   FillEllipsePlay;
  7801.   SectorPlay;
  7802.   WriteModePlay;
  7803.  
  7804.   ColorPlay;
  7805.   { PalettePlay only intended to work on these drivers: }
  7806.   if (GraphDriver = EGA) or
  7807.       (GraphDriver = EGA64) or
  7808.       (GraphDriver = VGA) then
  7809.      PalettePlay;
  7810.   PutPixelPlay;
  7811. {  PutImagePlay; }
  7812.   RandBarPlay;
  7813.   BarPlay;
  7814.   Bar3DPlay;
  7815.   ArcPlay;
  7816.   CirclePlay;
  7817.   PiePlay;
  7818.   LineToPlay;
  7819.   LineRelPlay;
  7820. {  LineStylePlay; }
  7821. {  UserLineStylePlay; }
  7822.   TextDump;
  7823.   TextPlay;
  7824.   CrtModePlay;
  7825.   FillStylePlay;
  7826.   FillPatternPlay;
  7827.   PolyPlay;
  7828.   SayGoodbye;
  7829. {  CloseGraph; }
  7830.   CloseVesa;
  7831. end.
  7832. ***************************************************
  7833.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  7834.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  7835. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  7836. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  7837.     Color := RandColor;
  7838.     SetColor(Color);
  7839.     SetFillStyle(Random(CloseDotFill)+1, Color);
  7840.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  7841.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  7842.   until KeyPressed;
  7843.   WaitToGo;
  7844. end; { RandBarPlay }
  7845.  
  7846. procedure ArcPlay;
  7847. { Draw random arcs on the screen }
  7848. var
  7849.   MaxRadius : word;
  7850.   EndAngle : word;
  7851.   ArcInfo : ArcCoordsType;
  7852. begin
  7853.   MainWindow('Arc / GetArcCoords demonstration');
  7854.   StatusLine('Esc aborts or press a key');
  7855.   MaxRadius := MaxY div 10;
  7856.   repeat
  7857.     SetColor(RandColor);
  7858.     EndAngle := Random(360);
  7859.     SetLineStyle(SolidLn, 0, NormWidth);
  7860.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  7861.     GetArcCoords(ArcInfo);
  7862.     with ArcInfo do
  7863.     begin
  7864.       Line(X, Y, XStart, YStart);
  7865.       Line(X, Y, Xend, Yend);
  7866.     end;
  7867.   until KeyPressed;
  7868.   WaitToGo;
  7869. end; { ArcPlay }
  7870.  
  7871. procedure PutPixelPlay;
  7872. { Demonstrate the PutPixel and GetPixel commands }
  7873. const
  7874.   Seed   = 1962; { A seed for the random number generator }
  7875.   NumPts = 2000; { The number of pixels plotted }
  7876.   Esc    = #27;
  7877. var
  7878.   I : word;
  7879.   X, Y, Color : word;
  7880.   XMax, YMax  : integer;
  7881.   ViewInfo    : ViewPortType;
  7882. begin
  7883.   MainWindow('PutPixel / GetPixel demonstration');
  7884.   StatusLine('Esc aborts or press a key...');
  7885.  
  7886.   GetViewSettings(ViewInfo);
  7887.   with ViewInfo do
  7888.   begin
  7889.     XMax := (x2-x1-1);
  7890.     YMax := (y2-y1-1);
  7891.   end;
  7892.  
  7893.   while not KeyPressed do
  7894.   begin
  7895.     { Plot random pixels }
  7896.     RandSeed := Seed;
  7897.     I := 0;
  7898.     while (not KeyPressed) and (I < NumPts) do
  7899.     begin
  7900.       Inc(I);
  7901.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  7902.     end;
  7903.  
  7904.     { Erase pixels }
  7905.     RandSeed := Seed;
  7906.     I := 0;
  7907.     while (not KeyPressed) and (I < NumPts) do
  7908.     begin
  7909.       Inc(I);
  7910.       X := Random(XMax)+1;
  7911.       Y := Random(YMax)+1;
  7912.       Color := GetPixel(X, Y);
  7913.         if Color = RandColor then
  7914.           PutPixel(X, Y, 0);
  7915.      end;
  7916.   end;
  7917.   WaitToGo;
  7918. end; { PutPixelPlay }
  7919.  
  7920. procedure PutImagePlay;
  7921. { Demonstrate the GetImage and PutImage commands }
  7922.  
  7923. const
  7924.   r  = 20;
  7925.   StartX = 100;
  7926.   StartY = 50;
  7927.  
  7928. var
  7929.   CurPort : ViewPortType;
  7930.  
  7931. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  7932. var
  7933.   Step : integer;
  7934. begin
  7935.   Step := Random(2*r);
  7936.   if Odd(Step) then
  7937.     Step := -Step;
  7938.   X := X + Step;
  7939.   Step := Random(r);
  7940.   if Odd(Step) then
  7941.     Step := -Step;
  7942.   Y := Y + Step;
  7943.  
  7944.   { Make saucer bounce off viewport walls }
  7945.   with CurPort do
  7946.   begin
  7947.     if (x1 + X + Width - 1 > x2) then
  7948.       X := x2-x1 - Width + 1
  7949.     else
  7950.       if (X < 0) then
  7951.         X := 0;
  7952.     if (y1 + Y + Height - 1 > y2) then
  7953.       Y := y2-y1 - Height + 1
  7954.     else
  7955.       if (Y < 0) then
  7956.         Y := 0;
  7957.   end;
  7958. end; { MoveSaucer }
  7959.  
  7960. var
  7961.   Pausetime : word;
  7962.   Saucer    : pointer;
  7963.   X, Y      : integer;
  7964.   ulx, uly  : word;
  7965.   lrx, lry  : word;
  7966.   Size      : word;
  7967.   I         : word;
  7968. begin
  7969.   ClearDevice;
  7970.   FullPort;
  7971.  
  7972.   { PaintScreen }
  7973.   ClearDevice;
  7974.   MainWindow('GetImage / PutImage Demonstration');
  7975.   StatusLine('Esc aborts or press a key...');
  7976.   GetViewSettings(CurPort);
  7977.  
  7978.   { DrawSaucer }
  7979.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  7980.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  7981.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  7982.   Circle(StartX+10, StartY-12, 2);
  7983.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  7984.   Circle(StartX-10, StartY-12, 2);
  7985.   SetFillStyle(SolidFill, MaxColor);
  7986.   FloodFill(StartX+1, StartY+4, GetColor);
  7987.  
  7988.   { ReadSaucerImage }
  7989.   ulx := StartX-(r+1);
  7990.   uly := StartY-14;
  7991.   lrx := StartX+(r+1);
  7992.   lry := StartY+(r div 3)+3;
  7993.  
  7994.   Size := ImageSize(ulx, uly, lrx, lry);
  7995.   GetMem(Saucer, Size);
  7996.   GetImage(ulx, uly, lrx, lry, Saucer^);
  7997. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  7998.  
  7999.   { Plot some "stars" }
  8000.   for I := 1 to 1000 do
  8001.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  8002.   X := MaxX div 2;
  8003.   Y := MaxY div 2;
  8004.   PauseTime := 70;
  8005.  
  8006.   { Move the saucer around }
  8007.   repeat
  8008. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  8009.      Delay(PauseTime);
  8010. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  8011.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  8012.   until KeyPressed;
  8013.   FreeMem(Saucer, size);
  8014.   WaitToGo;
  8015. end; { PutImagePlay }
  8016.  
  8017. procedure PolyPlay;
  8018. { Draw random polygons with random fill styles on the screen }
  8019. const
  8020.   MaxPts = 5;
  8021. type
  8022.   PolygonType = array[1..MaxPts] of PointType;
  8023. var
  8024.   Poly : PolygonType;
  8025.   I, Color : word;
  8026. begin
  8027.   MainWindow('FillPoly demonstration');
  8028.   StatusLine('Esc aborts or press a key...');
  8029.   repeat
  8030.     Color := RandColor;
  8031.     SetFillStyle(Random(11)+1, Color);
  8032.     SetColor(Color);
  8033.     for I := 1 to MaxPts do
  8034.       with Poly[I] do
  8035.       begin
  8036.         X := Random(MaxX);
  8037.         Y := Random(MaxY);
  8038.       end;
  8039.     FillPoly(MaxPts, Poly);
  8040.   until KeyPressed;
  8041.   WaitToGo;
  8042. end; { PolyPlay }
  8043.  
  8044. procedure FillStylePlay;
  8045. { Display all of the predefined fill styles available }
  8046. var
  8047.   Style    : word;
  8048.   Width    : word;
  8049.   Height   : word;
  8050.   X, Y     : word;
  8051.   I, J     : word;
  8052.   ViewInfo : ViewPortType;
  8053.  
  8054. procedure DrawBox(X, Y : word);
  8055. begin
  8056.   SetFillStyle(Style, MaxColor);
  8057.   with ViewInfo do
  8058.     Bar(X, Y, X+Width, Y+Height);
  8059.   Rectangle(X, Y, X+Width, Y+Height);
  8060.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  8061.   Inc(Style);
  8062. end; { DrawBox }
  8063.  
  8064. begin
  8065.   MainWindow('Pre-defined fill styles');
  8066.   GetViewSettings(ViewInfo);
  8067.   with ViewInfo do
  8068.   begin
  8069.     Width := 2 * ((x2+1) div 13);
  8070.     Height := 2 * ((y2-10) div 10);
  8071.   end;
  8072.   X := Width div 2;
  8073.   Y := Height div 2;
  8074.   Style := 0;
  8075.   for J := 1 to 3 do
  8076.   begin
  8077.     for I := 1 to 4 do
  8078.     begin
  8079.       DrawBox(X, Y);
  8080.       Inc(X, (Width div 2) * 3);
  8081.     end;
  8082.     X := Width div 2;
  8083.     Inc(Y, (Height div 2) * 3);
  8084.   end;
  8085.   SetTextJustify(LeftText, TopText);
  8086.   WaitToGo;
  8087. end; { FillStylePlay }
  8088.  
  8089. procedure FillPatternPlay;
  8090. { Display some user defined fill patterns }
  8091. const
  8092.   Patterns : array[0..11] of FillPatternType = (
  8093.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  8094.             OldColor which has a path of pixels of OldColor or NewColor
  8095.             with sides touching back to the seed point, (XSeed, YSeed).
  8096.             Therefore, only pixels of OldColor are modified and no other
  8097.             information is changed.
  8098.  
  8099.             SEE ALSO
  8100.  
  8101.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  8102.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  8103.             SETVIEW
  8104.  
  8105.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  8106.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  8107.             IF WHICHVGA = 0 THEN STOP
  8108.             DUMMY=RES640
  8109.             SETVIEW 100, 100, 539, 379
  8110.             FILLVIEW 10
  8111.             WHILE INKEY$ = ""
  8112.             WEND
  8113.             VIDEOMODESET VMODE
  8114.             END
  8115.  
  8116.  
  8117.  
  8118.  
  8119.  
  8120.  
  8121.  
  8122.  
  8123.  
  8124.  
  8125.  
  8126.  
  8127.  
  8128.  
  8129.  
  8130.  
  8131.                                                                          63
  8132.  
  8133.  
  8134.  
  8135.  
  8136.  
  8137.           FONTGETINFO
  8138.  
  8139.             PROTOTYPE
  8140.  
  8141.             SUB FONTGETINFO (Width%, Height%)
  8142.  
  8143.             INPUT
  8144.  
  8145.             no input parameters
  8146.     WEND
  8147.             MOUSEEXIT
  8148.             VIDEOMODESET VMODE
  8149.             END
  8150.  
  8151.  
  8152.  
  8153.  
  8154.  
  8155.  
  8156.  
  8157.  
  8158.  
  8159.  
  8160.  
  8161.  
  8162.  
  8163.  
  8164.  
  8165.  
  8166.  
  8167.  
  8168.  
  8169.  
  8170.  
  8171.  
  8172.  
  8173.  
  8174.  
  8175.  
  8176.  
  8177.  
  8178.  
  8179.  
  8180.  
  8181.  
  8182.  
  8183.  
  8184.  
  8185.  
  8186.  
  8187.  
  8188.  
  8189.  
  8190.                                                                          86
  8191.  
  8192.  
  8193.  
  8194.  
  8195.  
  8196.           MOUSECURSORDEFAULT
  8197.  
  8198.             PROTOTYPE
  8199.  
  8200.             SUB MOUSECURSORDEFAULT ()
  8201.  
  8202.             INPUT
  8203.  
  8204.             no input parameters
  8205.  
  8206.             OUTPUT
  8207.  
  8208.             no value returned
  8209.  
  8210.             USAGE
  8211.  
  8212.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  8213.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  8214. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  8215. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  8216. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  8217. $╤
  8218. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  8219. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  8220. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  8221.       end;
  8222.     end;
  8223.   end;
  8224.   WaitToGo;
  8225. end; { UserLineStylePlay }
  8226.  
  8227.  
  8228. procedure SayGoodbye;
  8229. { Say goodbye and then exit the program }
  8230. var
  8231.   ViewInfo : ViewPortType;
  8232. begin
  8233.   MainWindow('');
  8234.   GetViewSettings(ViewInfo);
  8235.   SetTextStyle(TriplexFont, HorizDir, 4);
  8236.   SetTextJustify(CenterText, CenterText);
  8237.   with ViewInfo do
  8238.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  8239.   StatusLine('Press any key to quit...');
  8240.   repeat until KeyPressed;
  8241. end; { SayGoodbye }
  8242.  
  8243.  
  8244. PROCEDURE SelectMode;
  8245. VAR
  8246.     choice1,choice2     : CHAR;
  8247.    xsize,ysize            : WORD;
  8248. BEGIN
  8249.     (* Let's select a mode *)
  8250.     ClrScr;
  8251.     WriteLn('VESADEMO:');
  8252.     WriteLn('1. 256 colors');
  8253.     WriteLn('2. 32768 colors');
  8254.     WriteLn('3. 65536 colors');
  8255.     WriteLn('4. 16777216 colors');
  8256.     WriteLn('Q uit');
  8257.     WriteLn;
  8258.     Write('Your choice: ');
  8259.     REPEAT
  8260.         ReadLn(choice1);
  8261.       IF choice1 <> '1' THEN BEGIN
  8262.           WriteLn('Sorry !');
  8263.          WriteLn('This demo wasn''t written for more as 256 colors !');
  8264.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  8265.          WriteLn('Switching to 256 colors.');
  8266.          choice1 := '1';
  8267.       END;
  8268.     UNTIL choice1 IN ['1'..'4','q'];
  8269.     IF choice1 = 'q' THEN Halt;
  8270.  
  8271.     WriteLn;
  8272.     WriteLn;
  8273.     WriteLn('a. 320x200');
  8274.     WriteLn('b. 640x480');
  8275.     WriteLn('c. 800x600');
  8276.     WriteLn('d. 1024x768');
  8277.     WriteLn('e. 1280x1024');
  8278.     WriteLn('Q uit');
  8279.     WriteLn;
  8280.     Write('Your choice: ');
  8281.     REPEAT
  8282.         ReadLn(choice2);
  8283.     UNTIL choice2 IN ['a'..'e','q'];
  8284.     IF choice2 = 'q' THEN Halt;
  8285.  
  8286.     CASE choice2 OF
  8287.         'a' : BEGIN
  8288.             xsize := 320;
  8289.             ysize := 200;
  8290.         END;
  8291.         'b' : BEGIN
  8292.             xsize := 640;
  8293.             ysize := 480;
  8294.         END;
  8295.         'c' : BEGIN
  8296.             xsize := 800;
  8297.             ysize := 600;
  8298.         END;
  8299.         'd' : BEGIN
  8300.             xsize := 1024;
  8301.             ysize := 768;
  8302.         END;
  8303.         'e' : BEGIN
  8304.             xsize := 1280;
  8305.             ysize := 1024;
  8306.         END;
  8307.     END;
  8308.     CASE choice1 OF
  8309.         '1' : mode := FindVesaMode(xsize,ysize,8);
  8310.         '2' : mode := FindVesaMode(xsize,ysize,15);
  8311.         '3' : mode := FindVesaMode(xsize,ysize,16);
  8312.         '4' : mode := FindVesaMode(xsize,ysize,24);
  8313.     END;
  8314.     IF mode = 0 THEN BEGIN
  8315.         WriteLn('No such mode could be found !');
  8316.         WriteLn('Switching to to 320x200.');
  8317.         ReadKey;
  8318.         mode := V320x200x256;
  8319.     END;
  8320. END;
  8321.  
  8322. begin { program body }
  8323.   SelectMode;
  8324.   Initialize;
  8325.   ReportStatus;
  8326.  
  8327. {  AspectRatioPlay; }
  8328.   FillEllipsePlay;
  8329.   SectorPlay;
  8330.   WriteModePlay;
  8331.  
  8332.   ColorPlay;
  8333.   { PalettePlay only intended to work on these drivers: }
  8334.   if (GraphDriver = EGA) or
  8335.       (GraphDriver = EGA64) or
  8336.       (GraphDriver = VGA) then
  8337.      PalettePlay;
  8338.   PutPixelPlay;
  8339. {  PutImagePlay; }
  8340.   RandBarPlay;
  8341.   BarPlay;
  8342.   Bar3DPlay;
  8343.   ArcPlay;
  8344.   CirclePlay;
  8345.   PiePlay;
  8346.   LineToPlay;
  8347.   LineRelPlay;
  8348. {  LineStylePlay; }
  8349. {  UserLineStylePlay; }
  8350.   TextDump;
  8351.   TextPlay;
  8352.   CrtModePlay;
  8353.   FillStylePlay;
  8354.   FillPatternPlay;
  8355.   PolyPlay;
  8356.   SayGoodbye;
  8357. {  CloseGraph; }
  8358.   CloseVesa;
  8359. end.
  8360. ***************************************************
  8361.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  8362.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  8363. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  8364. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  8365.     Color := RandColor;
  8366.     SetColor(Color);
  8367.     SetFillStyle(Random(CloseDotFill)+1, Color);
  8368.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  8369.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  8370.   until KeyPressed;
  8371.   WaitToGo;
  8372. end; { RandBarPlay }
  8373.  
  8374. procedure ArcPlay;
  8375. { Draw random arcs on the screen }
  8376. var
  8377.   MaxRadius : word;
  8378.   EndAngle : word;
  8379.   ArcInfo : ArcCoordsType;
  8380. begin
  8381.   MainWindow('Arc / GetArcCoords demonstration');
  8382.   StatusLine('Esc aborts or press a key');
  8383.   MaxRadius := MaxY div 10;
  8384.   repeat
  8385.     SetColor(RandColor);
  8386.     EndAngle := Random(360);
  8387.     SetLineStyle(SolidLn, 0, NormWidth);
  8388.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  8389.     GetArcCoords(ArcInfo);
  8390.     with ArcInfo do
  8391.     begin
  8392.       Line(X, Y, XStart, YStart);
  8393.       Line(X, Y, Xend, Yend);
  8394.     end;
  8395.   until KeyPressed;
  8396.   WaitToGo;
  8397. end; { ArcPlay }
  8398.  
  8399. procedure PutPixelPlay;
  8400. { Demonstrate the PutPixel and GetPixel commands }
  8401. const
  8402.   Seed   = 1962; { A seed for the random number generator }
  8403.   NumPts = 2000; { The number of pixels plotted }
  8404.   Esc    = #27;
  8405. var
  8406.   I : word;
  8407.   X, Y, Color : word;
  8408.   XMax, YMax  : integer;
  8409.   ViewInfo    : ViewPortType;
  8410. begin
  8411.   MainWindow('PutPixel / GetPixel demonstration');
  8412.   StatusLine('Esc aborts or press a key...');
  8413.  
  8414.   GetViewSettings(ViewInfo);
  8415.   with ViewInfo do
  8416.   begin
  8417.     XMax := (x2-x1-1);
  8418.     YMax := (y2-y1-1);
  8419.   end;
  8420.  
  8421.   while not KeyPressed do
  8422.   begin
  8423.     { Plot random pixels }
  8424.     RandSeed := Seed;
  8425.     I := 0;
  8426.     while (not KeyPressed) and (I < NumPts) do
  8427.     begin
  8428.       Inc(I);
  8429.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  8430.     end;
  8431.  
  8432.     { Erase pixels }
  8433.     RandSeed := Seed;
  8434.     I := 0;
  8435.     while (not KeyPressed) and (I < NumPts) do
  8436.     begin
  8437.       Inc(I);
  8438.       X := Random(XMax)+1;
  8439.       Y := Random(YMax)+1;
  8440.       Color := GetPixel(X, Y);
  8441.         if Color = RandColor then
  8442.           PutPixel(X, Y, 0);
  8443.      end;
  8444.   end;
  8445.   WaitToGo;
  8446. end; { PutPixelPlay }
  8447.  
  8448. procedure PutImagePlay;
  8449. { Demonstrate the GetImage and PutImage commands }
  8450.  
  8451. const
  8452.   r  = 20;
  8453.   StartX = 100;
  8454.   StartY = 50;
  8455.  
  8456. var
  8457.   CurPort : ViewPortType;
  8458.  
  8459. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  8460. var
  8461.   Step : integer;
  8462. begin
  8463.   Step := Random(2*r);
  8464.   if Odd(Step) then
  8465.     Step := -Step;
  8466.   X := X + Step;
  8467.   Step := Random(r);
  8468.   if Odd(Step) then
  8469.     Step := -Step;
  8470.   Y := Y + Step;
  8471.  
  8472.   { Make saucer bounce off viewport walls }
  8473.   with CurPort do
  8474.   begin
  8475.     if (x1 + X + Width - 1 > x2) then
  8476.       X := x2-x1 - Width + 1
  8477.     else
  8478.       if (X < 0) then
  8479.         X := 0;
  8480.     if (y1 + Y + Height - 1 > y2) then
  8481.       Y := y2-y1 - Height + 1
  8482.     else
  8483.       if (Y < 0) then
  8484.         Y := 0;
  8485.   end;
  8486. end; { MoveSaucer }
  8487.  
  8488. var
  8489.   Pausetime : word;
  8490.   Saucer    : pointer;
  8491.   X, Y      : integer;
  8492.   ulx, uly  : word;
  8493.   lrx, lry  : word;
  8494.   Size      : word;
  8495.   I         : word;
  8496. begin
  8497.   ClearDevice;
  8498.   FullPort;
  8499.  
  8500.   { PaintScreen }
  8501.   ClearDevice;
  8502.   MainWindow('GetImage / PutImage Demonstration');
  8503.   StatusLine('Esc aborts or press a key...');
  8504.   GetViewSettings(CurPort);
  8505.  
  8506.   { DrawSaucer }
  8507.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  8508.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  8509.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  8510.   Circle(StartX+10, StartY-12, 2);
  8511.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  8512.   Circle(StartX-10, StartY-12, 2);
  8513.   SetFillStyle(SolidFill, MaxColor);
  8514.   FloodFill(StartX+1, StartY+4, GetColor);
  8515.  
  8516.   { ReadSaucerImage }
  8517.   ulx := StartX-(r+1);
  8518.   uly := StartY-14;
  8519.   lrx := StartX+(r+1);
  8520.   lry := StartY+(r div 3)+3;
  8521.  
  8522.   Size := ImageSize(ulx, uly, lrx, lry);
  8523.   GetMem(Saucer, Size);
  8524.   GetImage(ulx, uly, lrx, lry, Saucer^);
  8525. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  8526.  
  8527.   { Plot some "stars" }
  8528.   for I := 1 to 1000 do
  8529.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  8530.   X := MaxX div 2;
  8531.   Y := MaxY div 2;
  8532.   PauseTime := 70;
  8533.  
  8534.   { Move the saucer around }
  8535.   repeat
  8536. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  8537.      Delay(PauseTime);
  8538. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  8539.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  8540.   until KeyPressed;
  8541.   FreeMem(Saucer, size);
  8542.   WaitToGo;
  8543. end; { PutImagePlay }
  8544.  
  8545. procedure PolyPlay;
  8546. { Draw random polygons with random fill styles on the screen }
  8547. const
  8548.   MaxPts = 5;
  8549. type
  8550.   PolygonType = array[1..MaxPts] of PointType;
  8551. var
  8552.   Poly : PolygonType;
  8553.   I, Color : word;
  8554. begin
  8555.   MainWindow('FillPoly demonstration');
  8556.   StatusLine('Esc aborts or press a key...');
  8557.   repeat
  8558.     Color := RandColor;
  8559.     SetFillStyle(Random(11)+1, Color);
  8560.     SetColor(Color);
  8561.     for I := 1 to MaxPts do
  8562.       with Poly[I] do
  8563.       begin
  8564.         X := Random(MaxX);
  8565.         Y := Random(MaxY);
  8566.       end;
  8567.     FillPoly(MaxPts, Poly);
  8568.   until KeyPressed;
  8569.   WaitToGo;
  8570. end; { PolyPlay }
  8571.  
  8572. procedure FillStylePlay;
  8573. { Display all of the predefined fill styles available }
  8574. var
  8575.   Style    : word;
  8576.   Width    : word;
  8577.   Height   : word;
  8578.   X, Y     : word;
  8579.   I, J     : word;
  8580.   ViewInfo : ViewPortType;
  8581.  
  8582. procedure DrawBox(X, Y : word);
  8583. begin
  8584.   SetFillStyle(Style, MaxColor);
  8585.   with ViewInfo do
  8586.     Bar(X, Y, X+Width, Y+Height);
  8587.   Rectangle(X, Y, X+Width, Y+Height);
  8588.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  8589.   Inc(Style);
  8590. end; { DrawBox }
  8591.  
  8592. begin
  8593.   MainWindow('Pre-defined fill styles');
  8594.   GetViewSettings(ViewInfo);
  8595.   with ViewInfo do
  8596.   begin
  8597.     Width := 2 * ((x2+1) div 13);
  8598.     Height := 2 * ((y2-10) div 10);
  8599.   end;
  8600.   X := Width div 2;
  8601.   Y := Height div 2;
  8602.   Style := 0;
  8603.   for J := 1 to 3 do
  8604.   begin
  8605.     for I := 1 to 4 do
  8606.     begin
  8607.       DrawBox(X, Y);
  8608.       Inc(X, (Width div 2) * 3);
  8609.     end;
  8610.     X := Width div 2;
  8611.     Inc(Y, (Height div 2) * 3);
  8612.   end;
  8613.   SetTextJustify(LeftText, TopText);
  8614.   WaitToGo;
  8615. end; { FillStylePlay }
  8616.  
  8617. procedure FillPatternPlay;
  8618. { Display some user defined fill patterns }
  8619. const
  8620.   Patterns : array[0..11] of FillPatternType = (
  8621.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  8622.             OldColor which has a path of pixels of OldColor or NewColor
  8623.             with sides touching back to the seed point, (XSeed, YSeed).
  8624.             Therefore, only pixels of OldColor are modified and no other
  8625.             information is changed.
  8626.  
  8627.             SEE ALSO
  8628.  
  8629.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  8630.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  8631.             SETVIEW
  8632.  
  8633.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  8634.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  8635.             IF WHICHVGA = 0 THEN STOP
  8636.             DUMMY=RES640
  8637.             SETVIEW 100, 100, 539, 379
  8638.             FILLVIEW 10
  8639.             WHILE INKEY$ = ""
  8640.             WEND
  8641.             VIDEOMODESET VMODE
  8642.             END
  8643.  
  8644.  
  8645.  
  8646.  
  8647.  
  8648.  
  8649.  
  8650.  
  8651.  
  8652.  
  8653.  
  8654.  
  8655.  
  8656.  
  8657.  
  8658.  
  8659.                                                                          63
  8660.  
  8661.  
  8662.  
  8663.  
  8664.  
  8665.           FONTGETINFO
  8666.  
  8667.             PROTOTYPE
  8668.  
  8669.             SUB FONTGETINFO (Width%, Height%)
  8670.  
  8671.             INPUT
  8672.  
  8673.             no input parameters
  8674.     WEND
  8675.             MOUSEEXIT
  8676.             VIDEOMODESET VMODE
  8677.             END
  8678.  
  8679.  
  8680.  
  8681.  
  8682.  
  8683.  
  8684.  
  8685.  
  8686.  
  8687.  
  8688.  
  8689.  
  8690.  
  8691.  
  8692.  
  8693.  
  8694.  
  8695.  
  8696.  
  8697.  
  8698.  
  8699.  
  8700.  
  8701.  
  8702.  
  8703.  
  8704.  
  8705.  
  8706.  
  8707.  
  8708.  
  8709.  
  8710.  
  8711.  
  8712.  
  8713.  
  8714.  
  8715.  
  8716.  
  8717.  
  8718.                                                                          86
  8719.  
  8720.  
  8721.  
  8722.  
  8723.  
  8724.           MOUSECURSORDEFAULT
  8725.  
  8726.             PROTOTYPE
  8727.  
  8728.             SUB MOUSECURSORDEFAULT ()
  8729.  
  8730.             INPUT
  8731.  
  8732.             no input parameters
  8733.  
  8734.             OUTPUT
  8735.  
  8736.             no value returned
  8737.  
  8738.             USAGE
  8739.  
  8740.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  8741.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  8742. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  8743. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  8744. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  8745. $╤
  8746. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  8747. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  8748. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  8749.       end;
  8750.     end;
  8751.   end;
  8752.   WaitToGo;
  8753. end; { UserLineStylePlay }
  8754.  
  8755.  
  8756. procedure SayGoodbye;
  8757. { Say goodbye and then exit the program }
  8758. var
  8759.   ViewInfo : ViewPortType;
  8760. begin
  8761.   MainWindow('');
  8762.   GetViewSettings(ViewInfo);
  8763.   SetTextStyle(TriplexFont, HorizDir, 4);
  8764.   SetTextJustify(CenterText, CenterText);
  8765.   with ViewInfo do
  8766.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  8767.   StatusLine('Press any key to quit...');
  8768.   repeat until KeyPressed;
  8769. end; { SayGoodbye }
  8770.  
  8771.  
  8772. PROCEDURE SelectMode;
  8773. VAR
  8774.     choice1,choice2     : CHAR;
  8775.    xsize,ysize            : WORD;
  8776. BEGIN
  8777.     (* Let's select a mode *)
  8778.     ClrScr;
  8779.     WriteLn('VESADEMO:');
  8780.     WriteLn('1. 256 colors');
  8781.     WriteLn('2. 32768 colors');
  8782.     WriteLn('3. 65536 colors');
  8783.     WriteLn('4. 16777216 colors');
  8784.     WriteLn('Q uit');
  8785.     WriteLn;
  8786.     Write('Your choice: ');
  8787.     REPEAT
  8788.         ReadLn(choice1);
  8789.       IF choice1 <> '1' THEN BEGIN
  8790.           WriteLn('Sorry !');
  8791.          WriteLn('This demo wasn''t written for more as 256 colors !');
  8792.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  8793.          WriteLn('Switching to 256 colors.');
  8794.          choice1 := '1';
  8795.       END;
  8796.     UNTIL choice1 IN ['1'..'4','q'];
  8797.     IF choice1 = 'q' THEN Halt;
  8798.  
  8799.     WriteLn;
  8800.     WriteLn;
  8801.     WriteLn('a. 320x200');
  8802.     WriteLn('b. 640x480');
  8803.     WriteLn('c. 800x600');
  8804.     WriteLn('d. 1024x768');
  8805.     WriteLn('e. 1280x1024');
  8806.     WriteLn('Q uit');
  8807.     WriteLn;
  8808.     Write('Your choice: ');
  8809.     REPEAT
  8810.         ReadLn(choice2);
  8811.     UNTIL choice2 IN ['a'..'e','q'];
  8812.     IF choice2 = 'q' THEN Halt;
  8813.  
  8814.     CASE choice2 OF
  8815.         'a' : BEGIN
  8816.             xsize := 320;
  8817.             ysize := 200;
  8818.         END;
  8819.         'b' : BEGIN
  8820.             xsize := 640;
  8821.             ysize := 480;
  8822.         END;
  8823.         'c' : BEGIN
  8824.             xsize := 800;
  8825.             ysize := 600;
  8826.         END;
  8827.         'd' : BEGIN
  8828.             xsize := 1024;
  8829.             ysize := 768;
  8830.         END;
  8831.         'e' : BEGIN
  8832.             xsize := 1280;
  8833.             ysize := 1024;
  8834.         END;
  8835.     END;
  8836.     CASE choice1 OF
  8837.         '1' : mode := FindVesaMode(xsize,ysize,8);
  8838.         '2' : mode := FindVesaMode(xsize,ysize,15);
  8839.         '3' : mode := FindVesaMode(xsize,ysize,16);
  8840.         '4' : mode := FindVesaMode(xsize,ysize,24);
  8841.     END;
  8842.     IF mode = 0 THEN BEGIN
  8843.         WriteLn('No such mode could be found !');
  8844.         WriteLn('Switching to to 320x200.');
  8845.         ReadKey;
  8846.         mode := V320x200x256;
  8847.     END;
  8848. END;
  8849.  
  8850. begin { program body }
  8851.   SelectMode;
  8852.   Initialize;
  8853.   ReportStatus;
  8854.  
  8855. {  AspectRatioPlay; }
  8856.   FillEllipsePlay;
  8857.   SectorPlay;
  8858.   WriteModePlay;
  8859.  
  8860.   ColorPlay;
  8861.   { PalettePlay only intended to work on these drivers: }
  8862.   if (GraphDriver = EGA) or
  8863.       (GraphDriver = EGA64) or
  8864.       (GraphDriver = VGA) then
  8865.      PalettePlay;
  8866.   PutPixelPlay;
  8867. {  PutImagePlay; }
  8868.   RandBarPlay;
  8869.   BarPlay;
  8870.   Bar3DPlay;
  8871.   ArcPlay;
  8872.   CirclePlay;
  8873.   PiePlay;
  8874.   LineToPlay;
  8875.   LineRelPlay;
  8876. {  LineStylePlay; }
  8877. {  UserLineStylePlay; }
  8878.   TextDump;
  8879.   TextPlay;
  8880.   CrtModePlay;
  8881.   FillStylePlay;
  8882.   FillPatternPlay;
  8883.   PolyPlay;
  8884.   SayGoodbye;
  8885. {  CloseGraph; }
  8886.   CloseVesa;
  8887. end.
  8888. ***************************************************
  8889.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  8890.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  8891. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  8892. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  8893.     Color := RandColor;
  8894.     SetColor(Color);
  8895.     SetFillStyle(Random(CloseDotFill)+1, Color);
  8896.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  8897.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  8898.   until KeyPressed;
  8899.   WaitToGo;
  8900. end; { RandBarPlay }
  8901.  
  8902. procedure ArcPlay;
  8903. { Draw random arcs on the screen }
  8904. var
  8905.   MaxRadius : word;
  8906.   EndAngle : word;
  8907.   ArcInfo : ArcCoordsType;
  8908. begin
  8909.   MainWindow('Arc / GetArcCoords demonstration');
  8910.   StatusLine('Esc aborts or press a key');
  8911.   MaxRadius := MaxY div 10;
  8912.   repeat
  8913.     SetColor(RandColor);
  8914.     EndAngle := Random(360);
  8915.     SetLineStyle(SolidLn, 0, NormWidth);
  8916.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  8917.     GetArcCoords(ArcInfo);
  8918.     with ArcInfo do
  8919.     begin
  8920.       Line(X, Y, XStart, YStart);
  8921.       Line(X, Y, Xend, Yend);
  8922.     end;
  8923.   until KeyPressed;
  8924.   WaitToGo;
  8925. end; { ArcPlay }
  8926.  
  8927. procedure PutPixelPlay;
  8928. { Demonstrate the PutPixel and GetPixel commands }
  8929. const
  8930.   Seed   = 1962; { A seed for the random number generator }
  8931.   NumPts = 2000; { The number of pixels plotted }
  8932.   Esc    = #27;
  8933. var
  8934.   I : word;
  8935.   X, Y, Color : word;
  8936.   XMax, YMax  : integer;
  8937.   ViewInfo    : ViewPortType;
  8938. begin
  8939.   MainWindow('PutPixel / GetPixel demonstration');
  8940.   StatusLine('Esc aborts or press a key...');
  8941.  
  8942.   GetViewSettings(ViewInfo);
  8943.   with ViewInfo do
  8944.   begin
  8945.     XMax := (x2-x1-1);
  8946.     YMax := (y2-y1-1);
  8947.   end;
  8948.  
  8949.   while not KeyPressed do
  8950.   begin
  8951.     { Plot random pixels }
  8952.     RandSeed := Seed;
  8953.     I := 0;
  8954.     while (not KeyPressed) and (I < NumPts) do
  8955.     begin
  8956.       Inc(I);
  8957.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  8958.     end;
  8959.  
  8960.     { Erase pixels }
  8961.     RandSeed := Seed;
  8962.     I := 0;
  8963.     while (not KeyPressed) and (I < NumPts) do
  8964.     begin
  8965.       Inc(I);
  8966.       X := Random(XMax)+1;
  8967.       Y := Random(YMax)+1;
  8968.       Color := GetPixel(X, Y);
  8969.         if Color = RandColor then
  8970.           PutPixel(X, Y, 0);
  8971.      end;
  8972.   end;
  8973.   WaitToGo;
  8974. end; { PutPixelPlay }
  8975.  
  8976. procedure PutImagePlay;
  8977. { Demonstrate the GetImage and PutImage commands }
  8978.  
  8979. const
  8980.   r  = 20;
  8981.   StartX = 100;
  8982.   StartY = 50;
  8983.  
  8984. var
  8985.   CurPort : ViewPortType;
  8986.  
  8987. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  8988. var
  8989.   Step : integer;
  8990. begin
  8991.   Step := Random(2*r);
  8992.   if Odd(Step) then
  8993.     Step := -Step;
  8994.   X := X + Step;
  8995.   Step := Random(r);
  8996.   if Odd(Step) then
  8997.     Step := -Step;
  8998.   Y := Y + Step;
  8999.  
  9000.   { Make saucer bounce off viewport walls }
  9001.   with CurPort do
  9002.   begin
  9003.     if (x1 + X + Width - 1 > x2) then
  9004.       X := x2-x1 - Width + 1
  9005.     else
  9006.       if (X < 0) then
  9007.         X := 0;
  9008.     if (y1 + Y + Height - 1 > y2) then
  9009.       Y := y2-y1 - Height + 1
  9010.     else
  9011.       if (Y < 0) then
  9012.         Y := 0;
  9013.   end;
  9014. end; { MoveSaucer }
  9015.  
  9016. var
  9017.   Pausetime : word;
  9018.   Saucer    : pointer;
  9019.   X, Y      : integer;
  9020.   ulx, uly  : word;
  9021.   lrx, lry  : word;
  9022.   Size      : word;
  9023.   I         : word;
  9024. begin
  9025.   ClearDevice;
  9026.   FullPort;
  9027.  
  9028.   { PaintScreen }
  9029.   ClearDevice;
  9030.   MainWindow('GetImage / PutImage Demonstration');
  9031.   StatusLine('Esc aborts or press a key...');
  9032.   GetViewSettings(CurPort);
  9033.  
  9034.   { DrawSaucer }
  9035.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  9036.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  9037.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  9038.   Circle(StartX+10, StartY-12, 2);
  9039.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  9040.   Circle(StartX-10, StartY-12, 2);
  9041.   SetFillStyle(SolidFill, MaxColor);
  9042.   FloodFill(StartX+1, StartY+4, GetColor);
  9043.  
  9044.   { ReadSaucerImage }
  9045.   ulx := StartX-(r+1);
  9046.   uly := StartY-14;
  9047.   lrx := StartX+(r+1);
  9048.   lry := StartY+(r div 3)+3;
  9049.  
  9050.   Size := ImageSize(ulx, uly, lrx, lry);
  9051.   GetMem(Saucer, Size);
  9052.   GetImage(ulx, uly, lrx, lry, Saucer^);
  9053. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  9054.  
  9055.   { Plot some "stars" }
  9056.   for I := 1 to 1000 do
  9057.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  9058.   X := MaxX div 2;
  9059.   Y := MaxY div 2;
  9060.   PauseTime := 70;
  9061.  
  9062.   { Move the saucer around }
  9063.   repeat
  9064. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  9065.      Delay(PauseTime);
  9066. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  9067.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  9068.   until KeyPressed;
  9069.   FreeMem(Saucer, size);
  9070.   WaitToGo;
  9071. end; { PutImagePlay }
  9072.  
  9073. procedure PolyPlay;
  9074. { Draw random polygons with random fill styles on the screen }
  9075. const
  9076.   MaxPts = 5;
  9077. type
  9078.   PolygonType = array[1..MaxPts] of PointType;
  9079. var
  9080.   Poly : PolygonType;
  9081.   I, Color : word;
  9082. begin
  9083.   MainWindow('FillPoly demonstration');
  9084.   StatusLine('Esc aborts or press a key...');
  9085.   repeat
  9086.     Color := RandColor;
  9087.     SetFillStyle(Random(11)+1, Color);
  9088.     SetColor(Color);
  9089.     for I := 1 to MaxPts do
  9090.       with Poly[I] do
  9091.       begin
  9092.         X := Random(MaxX);
  9093.         Y := Random(MaxY);
  9094.       end;
  9095.     FillPoly(MaxPts, Poly);
  9096.   until KeyPressed;
  9097.   WaitToGo;
  9098. end; { PolyPlay }
  9099.  
  9100. procedure FillStylePlay;
  9101. { Display all of the predefined fill styles available }
  9102. var
  9103.   Style    : word;
  9104.   Width    : word;
  9105.   Height   : word;
  9106.   X, Y     : word;
  9107.   I, J     : word;
  9108.   ViewInfo : ViewPortType;
  9109.  
  9110. procedure DrawBox(X, Y : word);
  9111. begin
  9112.   SetFillStyle(Style, MaxColor);
  9113.   with ViewInfo do
  9114.     Bar(X, Y, X+Width, Y+Height);
  9115.   Rectangle(X, Y, X+Width, Y+Height);
  9116.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  9117.   Inc(Style);
  9118. end; { DrawBox }
  9119.  
  9120. begin
  9121.   MainWindow('Pre-defined fill styles');
  9122.   GetViewSettings(ViewInfo);
  9123.   with ViewInfo do
  9124.   begin
  9125.     Width := 2 * ((x2+1) div 13);
  9126.     Height := 2 * ((y2-10) div 10);
  9127.   end;
  9128.   X := Width div 2;
  9129.   Y := Height div 2;
  9130.   Style := 0;
  9131.   for J := 1 to 3 do
  9132.   begin
  9133.     for I := 1 to 4 do
  9134.     begin
  9135.       DrawBox(X, Y);
  9136.       Inc(X, (Width div 2) * 3);
  9137.     end;
  9138.     X := Width div 2;
  9139.     Inc(Y, (Height div 2) * 3);
  9140.   end;
  9141.   SetTextJustify(LeftText, TopText);
  9142.   WaitToGo;
  9143. end; { FillStylePlay }
  9144.  
  9145. procedure FillPatternPlay;
  9146. { Display some user defined fill patterns }
  9147. const
  9148.   Patterns : array[0..11] of FillPatternType = (
  9149.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  9150.             OldColor which has a path of pixels of OldColor or NewColor
  9151.             with sides touching back to the seed point, (XSeed, YSeed).
  9152.             Therefore, only pixels of OldColor are modified and no other
  9153.             information is changed.
  9154.  
  9155.             SEE ALSO
  9156.  
  9157.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  9158.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  9159.             SETVIEW
  9160.  
  9161.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  9162.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  9163.             IF WHICHVGA = 0 THEN STOP
  9164.             DUMMY=RES640
  9165.             SETVIEW 100, 100, 539, 379
  9166.             FILLVIEW 10
  9167.             WHILE INKEY$ = ""
  9168.             WEND
  9169.             VIDEOMODESET VMODE
  9170.             END
  9171.  
  9172.  
  9173.  
  9174.  
  9175.  
  9176.  
  9177.  
  9178.  
  9179.  
  9180.  
  9181.  
  9182.  
  9183.  
  9184.  
  9185.  
  9186.  
  9187.                                                                          63
  9188.  
  9189.  
  9190.  
  9191.  
  9192.  
  9193.           FONTGETINFO
  9194.  
  9195.             PROTOTYPE
  9196.  
  9197.             SUB FONTGETINFO (Width%, Height%)
  9198.  
  9199.             INPUT
  9200.  
  9201.             no input parameters
  9202.     WEND
  9203.             MOUSEEXIT
  9204.             VIDEOMODESET VMODE
  9205.             END
  9206.  
  9207.  
  9208.  
  9209.  
  9210.  
  9211.  
  9212.  
  9213.  
  9214.  
  9215.  
  9216.  
  9217.  
  9218.  
  9219.  
  9220.  
  9221.  
  9222.  
  9223.  
  9224.  
  9225.  
  9226.  
  9227.  
  9228.  
  9229.  
  9230.  
  9231.  
  9232.  
  9233.  
  9234.  
  9235.  
  9236.  
  9237.  
  9238.  
  9239.  
  9240.  
  9241.  
  9242.  
  9243.  
  9244.  
  9245.  
  9246.                                                                          86
  9247.  
  9248.  
  9249.  
  9250.  
  9251.  
  9252.           MOUSECURSORDEFAULT
  9253.  
  9254.             PROTOTYPE
  9255.  
  9256.             SUB MOUSECURSORDEFAULT ()
  9257.  
  9258.             INPUT
  9259.  
  9260.             no input parameters
  9261.  
  9262.             OUTPUT
  9263.  
  9264.             no value returned
  9265.  
  9266.             USAGE
  9267.  
  9268.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  9269.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  9270. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  9271. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  9272. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  9273. $╤
  9274. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  9275. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  9276. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  9277.       end;
  9278.     end;
  9279.   end;
  9280.   WaitToGo;
  9281. end; { UserLineStylePlay }
  9282.  
  9283.  
  9284. procedure SayGoodbye;
  9285. { Say goodbye and then exit the program }
  9286. var
  9287.   ViewInfo : ViewPortType;
  9288. begin
  9289.   MainWindow('');
  9290.   GetViewSettings(ViewInfo);
  9291.   SetTextStyle(TriplexFont, HorizDir, 4);
  9292.   SetTextJustify(CenterText, CenterText);
  9293.   with ViewInfo do
  9294.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  9295.   StatusLine('Press any key to quit...');
  9296.   repeat until KeyPressed;
  9297. end; { SayGoodbye }
  9298.  
  9299.  
  9300. PROCEDURE SelectMode;
  9301. VAR
  9302.     choice1,choice2     : CHAR;
  9303.    xsize,ysize            : WORD;
  9304. BEGIN
  9305.     (* Let's select a mode *)
  9306.     ClrScr;
  9307.     WriteLn('VESADEMO:');
  9308.     WriteLn('1. 256 colors');
  9309.     WriteLn('2. 32768 colors');
  9310.     WriteLn('3. 65536 colors');
  9311.     WriteLn('4. 16777216 colors');
  9312.     WriteLn('Q uit');
  9313.     WriteLn;
  9314.     Write('Your choice: ');
  9315.     REPEAT
  9316.         ReadLn(choice1);
  9317.       IF choice1 <> '1' THEN BEGIN
  9318.           WriteLn('Sorry !');
  9319.          WriteLn('This demo wasn''t written for more as 256 colors !');
  9320.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  9321.          WriteLn('Switching to 256 colors.');
  9322.          choice1 := '1';
  9323.       END;
  9324.     UNTIL choice1 IN ['1'..'4','q'];
  9325.     IF choice1 = 'q' THEN Halt;
  9326.  
  9327.     WriteLn;
  9328.     WriteLn;
  9329.     WriteLn('a. 320x200');
  9330.     WriteLn('b. 640x480');
  9331.     WriteLn('c. 800x600');
  9332.     WriteLn('d. 1024x768');
  9333.     WriteLn('e. 1280x1024');
  9334.     WriteLn('Q uit');
  9335.     WriteLn;
  9336.     Write('Your choice: ');
  9337.     REPEAT
  9338.         ReadLn(choice2);
  9339.     UNTIL choice2 IN ['a'..'e','q'];
  9340.     IF choice2 = 'q' THEN Halt;
  9341.  
  9342.     CASE choice2 OF
  9343.         'a' : BEGIN
  9344.             xsize := 320;
  9345.             ysize := 200;
  9346.         END;
  9347.         'b' : BEGIN
  9348.             xsize := 640;
  9349.             ysize := 480;
  9350.         END;
  9351.         'c' : BEGIN
  9352.             xsize := 800;
  9353.             ysize := 600;
  9354.         END;
  9355.         'd' : BEGIN
  9356.             xsize := 1024;
  9357.             ysize := 768;
  9358.         END;
  9359.         'e' : BEGIN
  9360.             xsize := 1280;
  9361.             ysize := 1024;
  9362.         END;
  9363.     END;
  9364.     CASE choice1 OF
  9365.         '1' : mode := FindVesaMode(xsize,ysize,8);
  9366.         '2' : mode := FindVesaMode(xsize,ysize,15);
  9367.         '3' : mode := FindVesaMode(xsize,ysize,16);
  9368.         '4' : mode := FindVesaMode(xsize,ysize,24);
  9369.     END;
  9370.     IF mode = 0 THEN BEGIN
  9371.         WriteLn('No such mode could be found !');
  9372.         WriteLn('Switching to to 320x200.');
  9373.         ReadKey;
  9374.         mode := V320x200x256;
  9375.     END;
  9376. END;
  9377.  
  9378. begin { program body }
  9379.   SelectMode;
  9380.   Initialize;
  9381.   ReportStatus;
  9382.  
  9383. {  AspectRatioPlay; }
  9384.   FillEllipsePlay;
  9385.   SectorPlay;
  9386.   WriteModePlay;
  9387.  
  9388.   ColorPlay;
  9389.   { PalettePlay only intended to work on these drivers: }
  9390.   if (GraphDriver = EGA) or
  9391.       (GraphDriver = EGA64) or
  9392.       (GraphDriver = VGA) then
  9393.      PalettePlay;
  9394.   PutPixelPlay;
  9395. {  PutImagePlay; }
  9396.   RandBarPlay;
  9397.   BarPlay;
  9398.   Bar3DPlay;
  9399.   ArcPlay;
  9400.   CirclePlay;
  9401.   PiePlay;
  9402.   LineToPlay;
  9403.   LineRelPlay;
  9404. {  LineStylePlay; }
  9405. {  UserLineStylePlay; }
  9406.   TextDump;
  9407.   TextPlay;
  9408.   CrtModePlay;
  9409.   FillStylePlay;
  9410.   FillPatternPlay;
  9411.   PolyPlay;
  9412.   SayGoodbye;
  9413. {  CloseGraph; }
  9414.   CloseVesa;
  9415. end.
  9416. ***************************************************
  9417.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  9418.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  9419. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  9420. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  9421.     Color := RandColor;
  9422.     SetColor(Color);
  9423.     SetFillStyle(Random(CloseDotFill)+1, Color);
  9424.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  9425.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  9426.   until KeyPressed;
  9427.   WaitToGo;
  9428. end; { RandBarPlay }
  9429.  
  9430. procedure ArcPlay;
  9431. { Draw random arcs on the screen }
  9432. var
  9433.   MaxRadius : word;
  9434.   EndAngle : word;
  9435.   ArcInfo : ArcCoordsType;
  9436. begin
  9437.   MainWindow('Arc / GetArcCoords demonstration');
  9438.   StatusLine('Esc aborts or press a key');
  9439.   MaxRadius := MaxY div 10;
  9440.   repeat
  9441.     SetColor(RandColor);
  9442.     EndAngle := Random(360);
  9443.     SetLineStyle(SolidLn, 0, NormWidth);
  9444.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  9445.     GetArcCoords(ArcInfo);
  9446.     with ArcInfo do
  9447.     begin
  9448.       Line(X, Y, XStart, YStart);
  9449.       Line(X, Y, Xend, Yend);
  9450.     end;
  9451.   until KeyPressed;
  9452.   WaitToGo;
  9453. end; { ArcPlay }
  9454.  
  9455. procedure PutPixelPlay;
  9456. { Demonstrate the PutPixel and GetPixel commands }
  9457. const
  9458.   Seed   = 1962; { A seed for the random number generator }
  9459.   NumPts = 2000; { The number of pixels plotted }
  9460.   Esc    = #27;
  9461. var
  9462.   I : word;
  9463.   X, Y, Color : word;
  9464.   XMax, YMax  : integer;
  9465.   ViewInfo    : ViewPortType;
  9466. begin
  9467.   MainWindow('PutPixel / GetPixel demonstration');
  9468.   StatusLine('Esc aborts or press a key...');
  9469.  
  9470.   GetViewSettings(ViewInfo);
  9471.   with ViewInfo do
  9472.   begin
  9473.     XMax := (x2-x1-1);
  9474.     YMax := (y2-y1-1);
  9475.   end;
  9476.  
  9477.   while not KeyPressed do
  9478.   begin
  9479.     { Plot random pixels }
  9480.     RandSeed := Seed;
  9481.     I := 0;
  9482.     while (not KeyPressed) and (I < NumPts) do
  9483.     begin
  9484.       Inc(I);
  9485.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  9486.     end;
  9487.  
  9488.     { Erase pixels }
  9489.     RandSeed := Seed;
  9490.     I := 0;
  9491.     while (not KeyPressed) and (I < NumPts) do
  9492.     begin
  9493.       Inc(I);
  9494.       X := Random(XMax)+1;
  9495.       Y := Random(YMax)+1;
  9496.       Color := GetPixel(X, Y);
  9497.         if Color = RandColor then
  9498.           PutPixel(X, Y, 0);
  9499.      end;
  9500.   end;
  9501.   WaitToGo;
  9502. end; { PutPixelPlay }
  9503.  
  9504. procedure PutImagePlay;
  9505. { Demonstrate the GetImage and PutImage commands }
  9506.  
  9507. const
  9508.   r  = 20;
  9509.   StartX = 100;
  9510.   StartY = 50;
  9511.  
  9512. var
  9513.   CurPort : ViewPortType;
  9514.  
  9515. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  9516. var
  9517.   Step : integer;
  9518. begin
  9519.   Step := Random(2*r);
  9520.   if Odd(Step) then
  9521.     Step := -Step;
  9522.   X := X + Step;
  9523.   Step := Random(r);
  9524.   if Odd(Step) then
  9525.     Step := -Step;
  9526.   Y := Y + Step;
  9527.  
  9528.   { Make saucer bounce off viewport walls }
  9529.   with CurPort do
  9530.   begin
  9531.     if (x1 + X + Width - 1 > x2) then
  9532.       X := x2-x1 - Width + 1
  9533.     else
  9534.       if (X < 0) then
  9535.         X := 0;
  9536.     if (y1 + Y + Height - 1 > y2) then
  9537.       Y := y2-y1 - Height + 1
  9538.     else
  9539.       if (Y < 0) then
  9540.         Y := 0;
  9541.   end;
  9542. end; { MoveSaucer }
  9543.  
  9544. var
  9545.   Pausetime : word;
  9546.   Saucer    : pointer;
  9547.   X, Y      : integer;
  9548.   ulx, uly  : word;
  9549.   lrx, lry  : word;
  9550.   Size      : word;
  9551.   I         : word;
  9552. begin
  9553.   ClearDevice;
  9554.   FullPort;
  9555.  
  9556.   { PaintScreen }
  9557.   ClearDevice;
  9558.   MainWindow('GetImage / PutImage Demonstration');
  9559.   StatusLine('Esc aborts or press a key...');
  9560.   GetViewSettings(CurPort);
  9561.  
  9562.   { DrawSaucer }
  9563.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  9564.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  9565.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  9566.   Circle(StartX+10, StartY-12, 2);
  9567.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  9568.   Circle(StartX-10, StartY-12, 2);
  9569.   SetFillStyle(SolidFill, MaxColor);
  9570.   FloodFill(StartX+1, StartY+4, GetColor);
  9571.  
  9572.   { ReadSaucerImage }
  9573.   ulx := StartX-(r+1);
  9574.   uly := StartY-14;
  9575.   lrx := StartX+(r+1);
  9576.   lry := StartY+(r div 3)+3;
  9577.  
  9578.   Size := ImageSize(ulx, uly, lrx, lry);
  9579.   GetMem(Saucer, Size);
  9580.   GetImage(ulx, uly, lrx, lry, Saucer^);
  9581. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  9582.  
  9583.   { Plot some "stars" }
  9584.   for I := 1 to 1000 do
  9585.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  9586.   X := MaxX div 2;
  9587.   Y := MaxY div 2;
  9588.   PauseTime := 70;
  9589.  
  9590.   { Move the saucer around }
  9591.   repeat
  9592. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  9593.      Delay(PauseTime);
  9594. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  9595.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  9596.   until KeyPressed;
  9597.   FreeMem(Saucer, size);
  9598.   WaitToGo;
  9599. end; { PutImagePlay }
  9600.  
  9601. procedure PolyPlay;
  9602. { Draw random polygons with random fill styles on the screen }
  9603. const
  9604.   MaxPts = 5;
  9605. type
  9606.   PolygonType = array[1..MaxPts] of PointType;
  9607. var
  9608.   Poly : PolygonType;
  9609.   I, Color : word;
  9610. begin
  9611.   MainWindow('FillPoly demonstration');
  9612.   StatusLine('Esc aborts or press a key...');
  9613.   repeat
  9614.     Color := RandColor;
  9615.     SetFillStyle(Random(11)+1, Color);
  9616.     SetColor(Color);
  9617.     for I := 1 to MaxPts do
  9618.       with Poly[I] do
  9619.       begin
  9620.         X := Random(MaxX);
  9621.         Y := Random(MaxY);
  9622.       end;
  9623.     FillPoly(MaxPts, Poly);
  9624.   until KeyPressed;
  9625.   WaitToGo;
  9626. end; { PolyPlay }
  9627.  
  9628. procedure FillStylePlay;
  9629. { Display all of the predefined fill styles available }
  9630. var
  9631.   Style    : word;
  9632.   Width    : word;
  9633.   Height   : word;
  9634.   X, Y     : word;
  9635.   I, J     : word;
  9636.   ViewInfo : ViewPortType;
  9637.  
  9638. procedure DrawBox(X, Y : word);
  9639. begin
  9640.   SetFillStyle(Style, MaxColor);
  9641.   with ViewInfo do
  9642.     Bar(X, Y, X+Width, Y+Height);
  9643.   Rectangle(X, Y, X+Width, Y+Height);
  9644.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  9645.   Inc(Style);
  9646. end; { DrawBox }
  9647.  
  9648. begin
  9649.   MainWindow('Pre-defined fill styles');
  9650.   GetViewSettings(ViewInfo);
  9651.   with ViewInfo do
  9652.   begin
  9653.     Width := 2 * ((x2+1) div 13);
  9654.     Height := 2 * ((y2-10) div 10);
  9655.   end;
  9656.   X := Width div 2;
  9657.   Y := Height div 2;
  9658.   Style := 0;
  9659.   for J := 1 to 3 do
  9660.   begin
  9661.     for I := 1 to 4 do
  9662.     begin
  9663.       DrawBox(X, Y);
  9664.       Inc(X, (Width div 2) * 3);
  9665.     end;
  9666.     X := Width div 2;
  9667.     Inc(Y, (Height div 2) * 3);
  9668.   end;
  9669.   SetTextJustify(LeftText, TopText);
  9670.   WaitToGo;
  9671. end; { FillStylePlay }
  9672.  
  9673. procedure FillPatternPlay;
  9674. { Display some user defined fill patterns }
  9675. const
  9676.   Patterns : array[0..11] of FillPatternType = (
  9677.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  9678.             OldColor which has a path of pixels of OldColor or NewColor
  9679.             with sides touching back to the seed point, (XSeed, YSeed).
  9680.             Therefore, only pixels of OldColor are modified and no other
  9681.             information is changed.
  9682.  
  9683.             SEE ALSO
  9684.  
  9685.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  9686.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  9687.             SETVIEW
  9688.  
  9689.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  9690.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  9691.             IF WHICHVGA = 0 THEN STOP
  9692.             DUMMY=RES640
  9693.             SETVIEW 100, 100, 539, 379
  9694.             FILLVIEW 10
  9695.             WHILE INKEY$ = ""
  9696.             WEND
  9697.             VIDEOMODESET VMODE
  9698.             END
  9699.  
  9700.  
  9701.  
  9702.  
  9703.  
  9704.  
  9705.  
  9706.  
  9707.  
  9708.  
  9709.  
  9710.  
  9711.  
  9712.  
  9713.  
  9714.  
  9715.                                                                          63
  9716.  
  9717.  
  9718.  
  9719.  
  9720.  
  9721.           FONTGETINFO
  9722.  
  9723.             PROTOTYPE
  9724.  
  9725.             SUB FONTGETINFO (Width%, Height%)
  9726.  
  9727.             INPUT
  9728.  
  9729.             no input parameters
  9730.     WEND
  9731.             MOUSEEXIT
  9732.             VIDEOMODESET VMODE
  9733.             END
  9734.  
  9735.  
  9736.  
  9737.  
  9738.  
  9739.  
  9740.  
  9741.  
  9742.  
  9743.  
  9744.  
  9745.  
  9746.  
  9747.  
  9748.  
  9749.  
  9750.  
  9751.  
  9752.  
  9753.  
  9754.  
  9755.  
  9756.  
  9757.  
  9758.  
  9759.  
  9760.  
  9761.  
  9762.  
  9763.  
  9764.  
  9765.  
  9766.  
  9767.  
  9768.  
  9769.  
  9770.  
  9771.  
  9772.  
  9773.  
  9774.                                                                          86
  9775.  
  9776.  
  9777.  
  9778.  
  9779.  
  9780.           MOUSECURSORDEFAULT
  9781.  
  9782.             PROTOTYPE
  9783.  
  9784.             SUB MOUSECURSORDEFAULT ()
  9785.  
  9786.             INPUT
  9787.  
  9788.             no input parameters
  9789.  
  9790.             OUTPUT
  9791.  
  9792.             no value returned
  9793.  
  9794.             USAGE
  9795.  
  9796.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  9797.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  9798. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  9799. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  9800. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  9801. $╤
  9802. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  9803. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  9804. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  9805.       end;
  9806.     end;
  9807.   end;
  9808.   WaitToGo;
  9809. end; { UserLineStylePlay }
  9810.  
  9811.  
  9812. procedure SayGoodbye;
  9813. { Say goodbye and then exit the program }
  9814. var
  9815.   ViewInfo : ViewPortType;
  9816. begin
  9817.   MainWindow('');
  9818.   GetViewSettings(ViewInfo);
  9819.   SetTextStyle(TriplexFont, HorizDir, 4);
  9820.   SetTextJustify(CenterText, CenterText);
  9821.   with ViewInfo do
  9822.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  9823.   StatusLine('Press any key to quit...');
  9824.   repeat until KeyPressed;
  9825. end; { SayGoodbye }
  9826.  
  9827.  
  9828. PROCEDURE SelectMode;
  9829. VAR
  9830.     choice1,choice2     : CHAR;
  9831.    xsize,ysize            : WORD;
  9832. BEGIN
  9833.     (* Let's select a mode *)
  9834.     ClrScr;
  9835.     WriteLn('VESADEMO:');
  9836.     WriteLn('1. 256 colors');
  9837.     WriteLn('2. 32768 colors');
  9838.     WriteLn('3. 65536 colors');
  9839.     WriteLn('4. 16777216 colors');
  9840.     WriteLn('Q uit');
  9841.     WriteLn;
  9842.     Write('Your choice: ');
  9843.     REPEAT
  9844.         ReadLn(choice1);
  9845.       IF choice1 <> '1' THEN BEGIN
  9846.           WriteLn('Sorry !');
  9847.          WriteLn('This demo wasn''t written for more as 256 colors !');
  9848.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  9849.          WriteLn('Switching to 256 colors.');
  9850.          choice1 := '1';
  9851.       END;
  9852.     UNTIL choice1 IN ['1'..'4','q'];
  9853.     IF choice1 = 'q' THEN Halt;
  9854.  
  9855.     WriteLn;
  9856.     WriteLn;
  9857.     WriteLn('a. 320x200');
  9858.     WriteLn('b. 640x480');
  9859.     WriteLn('c. 800x600');
  9860.     WriteLn('d. 1024x768');
  9861.     WriteLn('e. 1280x1024');
  9862.     WriteLn('Q uit');
  9863.     WriteLn;
  9864.     Write('Your choice: ');
  9865.     REPEAT
  9866.         ReadLn(choice2);
  9867.     UNTIL choice2 IN ['a'..'e','q'];
  9868.     IF choice2 = 'q' THEN Halt;
  9869.  
  9870.     CASE choice2 OF
  9871.         'a' : BEGIN
  9872.             xsize := 320;
  9873.             ysize := 200;
  9874.         END;
  9875.         'b' : BEGIN
  9876.             xsize := 640;
  9877.             ysize := 480;
  9878.         END;
  9879.         'c' : BEGIN
  9880.             xsize := 800;
  9881.             ysize := 600;
  9882.         END;
  9883.         'd' : BEGIN
  9884.             xsize := 1024;
  9885.             ysize := 768;
  9886.         END;
  9887.         'e' : BEGIN
  9888.             xsize := 1280;
  9889.             ysize := 1024;
  9890.         END;
  9891.     END;
  9892.     CASE choice1 OF
  9893.         '1' : mode := FindVesaMode(xsize,ysize,8);
  9894.         '2' : mode := FindVesaMode(xsize,ysize,15);
  9895.         '3' : mode := FindVesaMode(xsize,ysize,16);
  9896.         '4' : mode := FindVesaMode(xsize,ysize,24);
  9897.     END;
  9898.     IF mode = 0 THEN BEGIN
  9899.         WriteLn('No such mode could be found !');
  9900.         WriteLn('Switching to to 320x200.');
  9901.         ReadKey;
  9902.         mode := V320x200x256;
  9903.     END;
  9904. END;
  9905.  
  9906. begin { program body }
  9907.   SelectMode;
  9908.   Initialize;
  9909.   ReportStatus;
  9910.  
  9911. {  AspectRatioPlay; }
  9912.   FillEllipsePlay;
  9913.   SectorPlay;
  9914.   WriteModePlay;
  9915.  
  9916.   ColorPlay;
  9917.   { PalettePlay only intended to work on these drivers: }
  9918.   if (GraphDriver = EGA) or
  9919.       (GraphDriver = EGA64) or
  9920.       (GraphDriver = VGA) then
  9921.      PalettePlay;
  9922.   PutPixelPlay;
  9923. {  PutImagePlay; }
  9924.   RandBarPlay;
  9925.   BarPlay;
  9926.   Bar3DPlay;
  9927.   ArcPlay;
  9928.   CirclePlay;
  9929.   PiePlay;
  9930.   LineToPlay;
  9931.   LineRelPlay;
  9932. {  LineStylePlay; }
  9933. {  UserLineStylePlay; }
  9934.   TextDump;
  9935.   TextPlay;
  9936.   CrtModePlay;
  9937.   FillStylePlay;
  9938.   FillPatternPlay;
  9939.   PolyPlay;
  9940.   SayGoodbye;
  9941. {  CloseGraph; }
  9942.   CloseVesa;
  9943. end.
  9944. ***************************************************
  9945.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  9946.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  9947. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  9948. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  9949.     Color := RandColor;
  9950.     SetColor(Color);
  9951.     SetFillStyle(Random(CloseDotFill)+1, Color);
  9952.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  9953.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  9954.   until KeyPressed;
  9955.   WaitToGo;
  9956. end; { RandBarPlay }
  9957.  
  9958. procedure ArcPlay;
  9959. { Draw random arcs on the screen }
  9960. var
  9961.   MaxRadius : word;
  9962.   EndAngle : word;
  9963.   ArcInfo : ArcCoordsType;
  9964. begin
  9965.   MainWindow('Arc / GetArcCoords demonstration');
  9966.   StatusLine('Esc aborts or press a key');
  9967.   MaxRadius := MaxY div 10;
  9968.   repeat
  9969.     SetColor(RandColor);
  9970.     EndAngle := Random(360);
  9971.     SetLineStyle(SolidLn, 0, NormWidth);
  9972.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  9973.     GetArcCoords(ArcInfo);
  9974.     with ArcInfo do
  9975.     begin
  9976.       Line(X, Y, XStart, YStart);
  9977.       Line(X, Y, Xend, Yend);
  9978.     end;
  9979.   until KeyPressed;
  9980.   WaitToGo;
  9981. end; { ArcPlay }
  9982.  
  9983. procedure PutPixelPlay;
  9984. { Demonstrate the PutPixel and GetPixel commands }
  9985. const
  9986.   Seed   = 1962; { A seed for the random number generator }
  9987.   NumPts = 2000; { The number of pixels plotted }
  9988.   Esc    = #27;
  9989. var
  9990.   I : word;
  9991.   X, Y, Color : word;
  9992.   XMax, YMax  : integer;
  9993.   ViewInfo    : ViewPortType;
  9994. begin
  9995.   MainWindow('PutPixel / GetPixel demonstration');
  9996.   StatusLine('Esc aborts or press a key...');
  9997.  
  9998.   GetViewSettings(ViewInfo);
  9999.   with ViewInfo do
  10000.   begin
  10001.     XMax := (x2-x1-1);
  10002.     YMax := (y2-y1-1);
  10003.   end;
  10004.  
  10005.   while not KeyPressed do
  10006.   begin
  10007.     { Plot random pixels }
  10008.     RandSeed := Seed;
  10009.     I := 0;
  10010.     while (not KeyPressed) and (I < NumPts) do
  10011.     begin
  10012.       Inc(I);
  10013.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  10014.     end;
  10015.  
  10016.     { Erase pixels }
  10017.     RandSeed := Seed;
  10018.     I := 0;
  10019.     while (not KeyPressed) and (I < NumPts) do
  10020.     begin
  10021.       Inc(I);
  10022.       X := Random(XMax)+1;
  10023.       Y := Random(YMax)+1;
  10024.       Color := GetPixel(X, Y);
  10025.         if Color = RandColor then
  10026.           PutPixel(X, Y, 0);
  10027.      end;
  10028.   end;
  10029.   WaitToGo;
  10030. end; { PutPixelPlay }
  10031.  
  10032. procedure PutImagePlay;
  10033. { Demonstrate the GetImage and PutImage commands }
  10034.  
  10035. const
  10036.   r  = 20;
  10037.   StartX = 100;
  10038.   StartY = 50;
  10039.  
  10040. var
  10041.   CurPort : ViewPortType;
  10042.  
  10043. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  10044. var
  10045.   Step : integer;
  10046. begin
  10047.   Step := Random(2*r);
  10048.   if Odd(Step) then
  10049.     Step := -Step;
  10050.   X := X + Step;
  10051.   Step := Random(r);
  10052.   if Odd(Step) then
  10053.     Step := -Step;
  10054.   Y := Y + Step;
  10055.  
  10056.   { Make saucer bounce off viewport walls }
  10057.   with CurPort do
  10058.   begin
  10059.     if (x1 + X + Width - 1 > x2) then
  10060.       X := x2-x1 - Width + 1
  10061.     else
  10062.       if (X < 0) then
  10063.         X := 0;
  10064.     if (y1 + Y + Height - 1 > y2) then
  10065.       Y := y2-y1 - Height + 1
  10066.     else
  10067.       if (Y < 0) then
  10068.         Y := 0;
  10069.   end;
  10070. end; { MoveSaucer }
  10071.  
  10072. var
  10073.   Pausetime : word;
  10074.   Saucer    : pointer;
  10075.   X, Y      : integer;
  10076.   ulx, uly  : word;
  10077.   lrx, lry  : word;
  10078.   Size      : word;
  10079.   I         : word;
  10080. begin
  10081.   ClearDevice;
  10082.   FullPort;
  10083.  
  10084.   { PaintScreen }
  10085.   ClearDevice;
  10086.   MainWindow('GetImage / PutImage Demonstration');
  10087.   StatusLine('Esc aborts or press a key...');
  10088.   GetViewSettings(CurPort);
  10089.  
  10090.   { DrawSaucer }
  10091.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  10092.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  10093.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  10094.   Circle(StartX+10, StartY-12, 2);
  10095.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  10096.   Circle(StartX-10, StartY-12, 2);
  10097.   SetFillStyle(SolidFill, MaxColor);
  10098.   FloodFill(StartX+1, StartY+4, GetColor);
  10099.  
  10100.   { ReadSaucerImage }
  10101.   ulx := StartX-(r+1);
  10102.   uly := StartY-14;
  10103.   lrx := StartX+(r+1);
  10104.   lry := StartY+(r div 3)+3;
  10105.  
  10106.   Size := ImageSize(ulx, uly, lrx, lry);
  10107.   GetMem(Saucer, Size);
  10108.   GetImage(ulx, uly, lrx, lry, Saucer^);
  10109. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  10110.  
  10111.   { Plot some "stars" }
  10112.   for I := 1 to 1000 do
  10113.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  10114.   X := MaxX div 2;
  10115.   Y := MaxY div 2;
  10116.   PauseTime := 70;
  10117.  
  10118.   { Move the saucer around }
  10119.   repeat
  10120. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  10121.      Delay(PauseTime);
  10122. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  10123.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  10124.   until KeyPressed;
  10125.   FreeMem(Saucer, size);
  10126.   WaitToGo;
  10127. end; { PutImagePlay }
  10128.  
  10129. procedure PolyPlay;
  10130. { Draw random polygons with random fill styles on the screen }
  10131. const
  10132.   MaxPts = 5;
  10133. type
  10134.   PolygonType = array[1..MaxPts] of PointType;
  10135. var
  10136.   Poly : PolygonType;
  10137.   I, Color : word;
  10138. begin
  10139.   MainWindow('FillPoly demonstration');
  10140.   StatusLine('Esc aborts or press a key...');
  10141.   repeat
  10142.     Color := RandColor;
  10143.     SetFillStyle(Random(11)+1, Color);
  10144.     SetColor(Color);
  10145.     for I := 1 to MaxPts do
  10146.       with Poly[I] do
  10147.       begin
  10148.         X := Random(MaxX);
  10149.         Y := Random(MaxY);
  10150.       end;
  10151.     FillPoly(MaxPts, Poly);
  10152.   until KeyPressed;
  10153.   WaitToGo;
  10154. end; { PolyPlay }
  10155.  
  10156. procedure FillStylePlay;
  10157. { Display all of the predefined fill styles available }
  10158. var
  10159.   Style    : word;
  10160.   Width    : word;
  10161.   Height   : word;
  10162.   X, Y     : word;
  10163.   I, J     : word;
  10164.   ViewInfo : ViewPortType;
  10165.  
  10166. procedure DrawBox(X, Y : word);
  10167. begin
  10168.   SetFillStyle(Style, MaxColor);
  10169.   with ViewInfo do
  10170.     Bar(X, Y, X+Width, Y+Height);
  10171.   Rectangle(X, Y, X+Width, Y+Height);
  10172.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  10173.   Inc(Style);
  10174. end; { DrawBox }
  10175.  
  10176. begin
  10177.   MainWindow('Pre-defined fill styles');
  10178.   GetViewSettings(ViewInfo);
  10179.   with ViewInfo do
  10180.   begin
  10181.     Width := 2 * ((x2+1) div 13);
  10182.     Height := 2 * ((y2-10) div 10);
  10183.   end;
  10184.   X := Width div 2;
  10185.   Y := Height div 2;
  10186.   Style := 0;
  10187.   for J := 1 to 3 do
  10188.   begin
  10189.     for I := 1 to 4 do
  10190.     begin
  10191.       DrawBox(X, Y);
  10192.       Inc(X, (Width div 2) * 3);
  10193.     end;
  10194.     X := Width div 2;
  10195.     Inc(Y, (Height div 2) * 3);
  10196.   end;
  10197.   SetTextJustify(LeftText, TopText);
  10198.   WaitToGo;
  10199. end; { FillStylePlay }
  10200.  
  10201. procedure FillPatternPlay;
  10202. { Display some user defined fill patterns }
  10203. const
  10204.   Patterns : array[0..11] of FillPatternType = (
  10205.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  10206.             OldColor which has a path of pixels of OldColor or NewColor
  10207.             with sides touching back to the seed point, (XSeed, YSeed).
  10208.             Therefore, only pixels of OldColor are modified and no other
  10209.             information is changed.
  10210.  
  10211.             SEE ALSO
  10212.  
  10213.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  10214.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  10215.             SETVIEW
  10216.  
  10217.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  10218.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  10219.             IF WHICHVGA = 0 THEN STOP
  10220.             DUMMY=RES640
  10221.             SETVIEW 100, 100, 539, 379
  10222.             FILLVIEW 10
  10223.             WHILE INKEY$ = ""
  10224.             WEND
  10225.             VIDEOMODESET VMODE
  10226.             END
  10227.  
  10228.  
  10229.  
  10230.  
  10231.  
  10232.  
  10233.  
  10234.  
  10235.  
  10236.  
  10237.  
  10238.  
  10239.  
  10240.  
  10241.  
  10242.  
  10243.                                                                          63
  10244.  
  10245.  
  10246.  
  10247.  
  10248.  
  10249.           FONTGETINFO
  10250.  
  10251.             PROTOTYPE
  10252.  
  10253.             SUB FONTGETINFO (Width%, Height%)
  10254.  
  10255.             INPUT
  10256.  
  10257.             no input parameters
  10258.     WEND
  10259.             MOUSEEXIT
  10260.             VIDEOMODESET VMODE
  10261.             END
  10262.  
  10263.  
  10264.  
  10265.  
  10266.  
  10267.  
  10268.  
  10269.  
  10270.  
  10271.  
  10272.  
  10273.  
  10274.  
  10275.  
  10276.  
  10277.  
  10278.  
  10279.  
  10280.  
  10281.  
  10282.  
  10283.  
  10284.  
  10285.  
  10286.  
  10287.  
  10288.  
  10289.  
  10290.  
  10291.  
  10292.  
  10293.  
  10294.  
  10295.  
  10296.  
  10297.  
  10298.  
  10299.  
  10300.  
  10301.  
  10302.                                                                          86
  10303.  
  10304.  
  10305.  
  10306.  
  10307.  
  10308.           MOUSECURSORDEFAULT
  10309.  
  10310.             PROTOTYPE
  10311.  
  10312.             SUB MOUSECURSORDEFAULT ()
  10313.  
  10314.             INPUT
  10315.  
  10316.             no input parameters
  10317.  
  10318.             OUTPUT
  10319.  
  10320.             no value returned
  10321.  
  10322.             USAGE
  10323.  
  10324.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  10325.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  10326. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  10327. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  10328. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  10329. $╤
  10330. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  10331. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  10332. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  10333.       end;
  10334.     end;
  10335.   end;
  10336.   WaitToGo;
  10337. end; { UserLineStylePlay }
  10338.  
  10339.  
  10340. procedure SayGoodbye;
  10341. { Say goodbye and then exit the program }
  10342. var
  10343.   ViewInfo : ViewPortType;
  10344. begin
  10345.   MainWindow('');
  10346.   GetViewSettings(ViewInfo);
  10347.   SetTextStyle(TriplexFont, HorizDir, 4);
  10348.   SetTextJustify(CenterText, CenterText);
  10349.   with ViewInfo do
  10350.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  10351.   StatusLine('Press any key to quit...');
  10352.   repeat until KeyPressed;
  10353. end; { SayGoodbye }
  10354.  
  10355.  
  10356. PROCEDURE SelectMode;
  10357. VAR
  10358.     choice1,choice2     : CHAR;
  10359.    xsize,ysize            : WORD;
  10360. BEGIN
  10361.     (* Let's select a mode *)
  10362.     ClrScr;
  10363.     WriteLn('VESADEMO:');
  10364.     WriteLn('1. 256 colors');
  10365.     WriteLn('2. 32768 colors');
  10366.     WriteLn('3. 65536 colors');
  10367.     WriteLn('4. 16777216 colors');
  10368.     WriteLn('Q uit');
  10369.     WriteLn;
  10370.     Write('Your choice: ');
  10371.     REPEAT
  10372.         ReadLn(choice1);
  10373.       IF choice1 <> '1' THEN BEGIN
  10374.           WriteLn('Sorry !');
  10375.          WriteLn('This demo wasn''t written for more as 256 colors !');
  10376.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  10377.          WriteLn('Switching to 256 colors.');
  10378.          choice1 := '1';
  10379.       END;
  10380.     UNTIL choice1 IN ['1'..'4','q'];
  10381.     IF choice1 = 'q' THEN Halt;
  10382.  
  10383.     WriteLn;
  10384.     WriteLn;
  10385.     WriteLn('a. 320x200');
  10386.     WriteLn('b. 640x480');
  10387.     WriteLn('c. 800x600');
  10388.     WriteLn('d. 1024x768');
  10389.     WriteLn('e. 1280x1024');
  10390.     WriteLn('Q uit');
  10391.     WriteLn;
  10392.     Write('Your choice: ');
  10393.     REPEAT
  10394.         ReadLn(choice2);
  10395.     UNTIL choice2 IN ['a'..'e','q'];
  10396.     IF choice2 = 'q' THEN Halt;
  10397.  
  10398.     CASE choice2 OF
  10399.         'a' : BEGIN
  10400.             xsize := 320;
  10401.             ysize := 200;
  10402.         END;
  10403.         'b' : BEGIN
  10404.             xsize := 640;
  10405.             ysize := 480;
  10406.         END;
  10407.         'c' : BEGIN
  10408.             xsize := 800;
  10409.             ysize := 600;
  10410.         END;
  10411.         'd' : BEGIN
  10412.             xsize := 1024;
  10413.             ysize := 768;
  10414.         END;
  10415.         'e' : BEGIN
  10416.             xsize := 1280;
  10417.             ysize := 1024;
  10418.         END;
  10419.     END;
  10420.     CASE choice1 OF
  10421.         '1' : mode := FindVesaMode(xsize,ysize,8);
  10422.         '2' : mode := FindVesaMode(xsize,ysize,15);
  10423.         '3' : mode := FindVesaMode(xsize,ysize,16);
  10424.         '4' : mode := FindVesaMode(xsize,ysize,24);
  10425.     END;
  10426.     IF mode = 0 THEN BEGIN
  10427.         WriteLn('No such mode could be found !');
  10428.         WriteLn('Switching to to 320x200.');
  10429.         ReadKey;
  10430.         mode := V320x200x256;
  10431.     END;
  10432. END;
  10433.  
  10434. begin { program body }
  10435.   SelectMode;
  10436.   Initialize;
  10437.   ReportStatus;
  10438.  
  10439. {  AspectRatioPlay; }
  10440.   FillEllipsePlay;
  10441.   SectorPlay;
  10442.   WriteModePlay;
  10443.  
  10444.   ColorPlay;
  10445.   { PalettePlay only intended to work on these drivers: }
  10446.   if (GraphDriver = EGA) or
  10447.       (GraphDriver = EGA64) or
  10448.       (GraphDriver = VGA) then
  10449.      PalettePlay;
  10450.   PutPixelPlay;
  10451. {  PutImagePlay; }
  10452.   RandBarPlay;
  10453.   BarPlay;
  10454.   Bar3DPlay;
  10455.   ArcPlay;
  10456.   CirclePlay;
  10457.   PiePlay;
  10458.   LineToPlay;
  10459.   LineRelPlay;
  10460. {  LineStylePlay; }
  10461. {  UserLineStylePlay; }
  10462.   TextDump;
  10463.   TextPlay;
  10464.   CrtModePlay;
  10465.   FillStylePlay;
  10466.   FillPatternPlay;
  10467.   PolyPlay;
  10468.   SayGoodbye;
  10469. {  CloseGraph; }
  10470.   CloseVesa;
  10471. end.
  10472. ***************************************************
  10473.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  10474.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  10475. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  10476. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  10477.     Color := RandColor;
  10478.     SetColor(Color);
  10479.     SetFillStyle(Random(CloseDotFill)+1, Color);
  10480.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  10481.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  10482.   until KeyPressed;
  10483.   WaitToGo;
  10484. end; { RandBarPlay }
  10485.  
  10486. procedure ArcPlay;
  10487. { Draw random arcs on the screen }
  10488. var
  10489.   MaxRadius : word;
  10490.   EndAngle : word;
  10491.   ArcInfo : ArcCoordsType;
  10492. begin
  10493.   MainWindow('Arc / GetArcCoords demonstration');
  10494.   StatusLine('Esc aborts or press a key');
  10495.   MaxRadius := MaxY div 10;
  10496.   repeat
  10497.     SetColor(RandColor);
  10498.     EndAngle := Random(360);
  10499.     SetLineStyle(SolidLn, 0, NormWidth);
  10500.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  10501.     GetArcCoords(ArcInfo);
  10502.     with ArcInfo do
  10503.     begin
  10504.       Line(X, Y, XStart, YStart);
  10505.       Line(X, Y, Xend, Yend);
  10506.     end;
  10507.   until KeyPressed;
  10508.   WaitToGo;
  10509. end; { ArcPlay }
  10510.  
  10511. procedure PutPixelPlay;
  10512. { Demonstrate the PutPixel and GetPixel commands }
  10513. const
  10514.   Seed   = 1962; { A seed for the random number generator }
  10515.   NumPts = 2000; { The number of pixels plotted }
  10516.   Esc    = #27;
  10517. var
  10518.   I : word;
  10519.   X, Y, Color : word;
  10520.   XMax, YMax  : integer;
  10521.   ViewInfo    : ViewPortType;
  10522. begin
  10523.   MainWindow('PutPixel / GetPixel demonstration');
  10524.   StatusLine('Esc aborts or press a key...');
  10525.  
  10526.   GetViewSettings(ViewInfo);
  10527.   with ViewInfo do
  10528.   begin
  10529.     XMax := (x2-x1-1);
  10530.     YMax := (y2-y1-1);
  10531.   end;
  10532.  
  10533.   while not KeyPressed do
  10534.   begin
  10535.     { Plot random pixels }
  10536.     RandSeed := Seed;
  10537.     I := 0;
  10538.     while (not KeyPressed) and (I < NumPts) do
  10539.     begin
  10540.       Inc(I);
  10541.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  10542.     end;
  10543.  
  10544.     { Erase pixels }
  10545.     RandSeed := Seed;
  10546.     I := 0;
  10547.     while (not KeyPressed) and (I < NumPts) do
  10548.     begin
  10549.       Inc(I);
  10550.       X := Random(XMax)+1;
  10551.       Y := Random(YMax)+1;
  10552.       Color := GetPixel(X, Y);
  10553.         if Color = RandColor then
  10554.           PutPixel(X, Y, 0);
  10555.      end;
  10556.   end;
  10557.   WaitToGo;
  10558. end; { PutPixelPlay }
  10559.  
  10560. procedure PutImagePlay;
  10561. { Demonstrate the GetImage and PutImage commands }
  10562.  
  10563. const
  10564.   r  = 20;
  10565.   StartX = 100;
  10566.   StartY = 50;
  10567.  
  10568. var
  10569.   CurPort : ViewPortType;
  10570.  
  10571. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  10572. var
  10573.   Step : integer;
  10574. begin
  10575.   Step := Random(2*r);
  10576.   if Odd(Step) then
  10577.     Step := -Step;
  10578.   X := X + Step;
  10579.   Step := Random(r);
  10580.   if Odd(Step) then
  10581.     Step := -Step;
  10582.   Y := Y + Step;
  10583.  
  10584.   { Make saucer bounce off viewport walls }
  10585.   with CurPort do
  10586.   begin
  10587.     if (x1 + X + Width - 1 > x2) then
  10588.       X := x2-x1 - Width + 1
  10589.     else
  10590.       if (X < 0) then
  10591.         X := 0;
  10592.     if (y1 + Y + Height - 1 > y2) then
  10593.       Y := y2-y1 - Height + 1
  10594.     else
  10595.       if (Y < 0) then
  10596.         Y := 0;
  10597.   end;
  10598. end; { MoveSaucer }
  10599.  
  10600. var
  10601.   Pausetime : word;
  10602.   Saucer    : pointer;
  10603.   X, Y      : integer;
  10604.   ulx, uly  : word;
  10605.   lrx, lry  : word;
  10606.   Size      : word;
  10607.   I         : word;
  10608. begin
  10609.   ClearDevice;
  10610.   FullPort;
  10611.  
  10612.   { PaintScreen }
  10613.   ClearDevice;
  10614.   MainWindow('GetImage / PutImage Demonstration');
  10615.   StatusLine('Esc aborts or press a key...');
  10616.   GetViewSettings(CurPort);
  10617.  
  10618.   { DrawSaucer }
  10619.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  10620.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  10621.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  10622.   Circle(StartX+10, StartY-12, 2);
  10623.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  10624.   Circle(StartX-10, StartY-12, 2);
  10625.   SetFillStyle(SolidFill, MaxColor);
  10626.   FloodFill(StartX+1, StartY+4, GetColor);
  10627.  
  10628.   { ReadSaucerImage }
  10629.   ulx := StartX-(r+1);
  10630.   uly := StartY-14;
  10631.   lrx := StartX+(r+1);
  10632.   lry := StartY+(r div 3)+3;
  10633.  
  10634.   Size := ImageSize(ulx, uly, lrx, lry);
  10635.   GetMem(Saucer, Size);
  10636.   GetImage(ulx, uly, lrx, lry, Saucer^);
  10637. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  10638.  
  10639.   { Plot some "stars" }
  10640.   for I := 1 to 1000 do
  10641.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  10642.   X := MaxX div 2;
  10643.   Y := MaxY div 2;
  10644.   PauseTime := 70;
  10645.  
  10646.   { Move the saucer around }
  10647.   repeat
  10648. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  10649.      Delay(PauseTime);
  10650. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  10651.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  10652.   until KeyPressed;
  10653.   FreeMem(Saucer, size);
  10654.   WaitToGo;
  10655. end; { PutImagePlay }
  10656.  
  10657. procedure PolyPlay;
  10658. { Draw random polygons with random fill styles on the screen }
  10659. const
  10660.   MaxPts = 5;
  10661. type
  10662.   PolygonType = array[1..MaxPts] of PointType;
  10663. var
  10664.   Poly : PolygonType;
  10665.   I, Color : word;
  10666. begin
  10667.   MainWindow('FillPoly demonstration');
  10668.   StatusLine('Esc aborts or press a key...');
  10669.   repeat
  10670.     Color := RandColor;
  10671.     SetFillStyle(Random(11)+1, Color);
  10672.     SetColor(Color);
  10673.     for I := 1 to MaxPts do
  10674.       with Poly[I] do
  10675.       begin
  10676.         X := Random(MaxX);
  10677.         Y := Random(MaxY);
  10678.       end;
  10679.     FillPoly(MaxPts, Poly);
  10680.   until KeyPressed;
  10681.   WaitToGo;
  10682. end; { PolyPlay }
  10683.  
  10684. procedure FillStylePlay;
  10685. { Display all of the predefined fill styles available }
  10686. var
  10687.   Style    : word;
  10688.   Width    : word;
  10689.   Height   : word;
  10690.   X, Y     : word;
  10691.   I, J     : word;
  10692.   ViewInfo : ViewPortType;
  10693.  
  10694. procedure DrawBox(X, Y : word);
  10695. begin
  10696.   SetFillStyle(Style, MaxColor);
  10697.   with ViewInfo do
  10698.     Bar(X, Y, X+Width, Y+Height);
  10699.   Rectangle(X, Y, X+Width, Y+Height);
  10700.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  10701.   Inc(Style);
  10702. end; { DrawBox }
  10703.  
  10704. begin
  10705.   MainWindow('Pre-defined fill styles');
  10706.   GetViewSettings(ViewInfo);
  10707.   with ViewInfo do
  10708.   begin
  10709.     Width := 2 * ((x2+1) div 13);
  10710.     Height := 2 * ((y2-10) div 10);
  10711.   end;
  10712.   X := Width div 2;
  10713.   Y := Height div 2;
  10714.   Style := 0;
  10715.   for J := 1 to 3 do
  10716.   begin
  10717.     for I := 1 to 4 do
  10718.     begin
  10719.       DrawBox(X, Y);
  10720.       Inc(X, (Width div 2) * 3);
  10721.     end;
  10722.     X := Width div 2;
  10723.     Inc(Y, (Height div 2) * 3);
  10724.   end;
  10725.   SetTextJustify(LeftText, TopText);
  10726.   WaitToGo;
  10727. end; { FillStylePlay }
  10728.  
  10729. procedure FillPatternPlay;
  10730. { Display some user defined fill patterns }
  10731. const
  10732.   Patterns : array[0..11] of FillPatternType = (
  10733.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  10734.             OldColor which has a path of pixels of OldColor or NewColor
  10735.             with sides touching back to the seed point, (XSeed, YSeed).
  10736.             Therefore, only pixels of OldColor are modified and no other
  10737.             information is changed.
  10738.  
  10739.             SEE ALSO
  10740.  
  10741.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  10742.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  10743.             SETVIEW
  10744.  
  10745.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  10746.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  10747.             IF WHICHVGA = 0 THEN STOP
  10748.             DUMMY=RES640
  10749.             SETVIEW 100, 100, 539, 379
  10750.             FILLVIEW 10
  10751.             WHILE INKEY$ = ""
  10752.             WEND
  10753.             VIDEOMODESET VMODE
  10754.             END
  10755.  
  10756.  
  10757.  
  10758.  
  10759.  
  10760.  
  10761.  
  10762.  
  10763.  
  10764.  
  10765.  
  10766.  
  10767.  
  10768.  
  10769.  
  10770.  
  10771.                                                                          63
  10772.  
  10773.  
  10774.  
  10775.  
  10776.  
  10777.           FONTGETINFO
  10778.  
  10779.             PROTOTYPE
  10780.  
  10781.             SUB FONTGETINFO (Width%, Height%)
  10782.  
  10783.             INPUT
  10784.  
  10785.             no input parameters
  10786.     WEND
  10787.             MOUSEEXIT
  10788.             VIDEOMODESET VMODE
  10789.             END
  10790.  
  10791.  
  10792.  
  10793.  
  10794.  
  10795.  
  10796.  
  10797.  
  10798.  
  10799.  
  10800.  
  10801.  
  10802.  
  10803.  
  10804.  
  10805.  
  10806.  
  10807.  
  10808.  
  10809.  
  10810.  
  10811.  
  10812.  
  10813.  
  10814.  
  10815.  
  10816.  
  10817.  
  10818.  
  10819.  
  10820.  
  10821.  
  10822.  
  10823.  
  10824.  
  10825.  
  10826.  
  10827.  
  10828.  
  10829.  
  10830.                                                                          86
  10831.  
  10832.  
  10833.  
  10834.  
  10835.  
  10836.           MOUSECURSORDEFAULT
  10837.  
  10838.             PROTOTYPE
  10839.  
  10840.             SUB MOUSECURSORDEFAULT ()
  10841.  
  10842.             INPUT
  10843.  
  10844.             no input parameters
  10845.  
  10846.             OUTPUT
  10847.  
  10848.             no value returned
  10849.  
  10850.             USAGE
  10851.  
  10852.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  10853.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  10854. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  10855. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  10856. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  10857. $╤
  10858. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  10859. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  10860. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  10861.       end;
  10862.     end;
  10863.   end;
  10864.   WaitToGo;
  10865. end; { UserLineStylePlay }
  10866.  
  10867.  
  10868. procedure SayGoodbye;
  10869. { Say goodbye and then exit the program }
  10870. var
  10871.   ViewInfo : ViewPortType;
  10872. begin
  10873.   MainWindow('');
  10874.   GetViewSettings(ViewInfo);
  10875.   SetTextStyle(TriplexFont, HorizDir, 4);
  10876.   SetTextJustify(CenterText, CenterText);
  10877.   with ViewInfo do
  10878.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  10879.   StatusLine('Press any key to quit...');
  10880.   repeat until KeyPressed;
  10881. end; { SayGoodbye }
  10882.  
  10883.  
  10884. PROCEDURE SelectMode;
  10885. VAR
  10886.     choice1,choice2     : CHAR;
  10887.    xsize,ysize            : WORD;
  10888. BEGIN
  10889.     (* Let's select a mode *)
  10890.     ClrScr;
  10891.     WriteLn('VESADEMO:');
  10892.     WriteLn('1. 256 colors');
  10893.     WriteLn('2. 32768 colors');
  10894.     WriteLn('3. 65536 colors');
  10895.     WriteLn('4. 16777216 colors');
  10896.     WriteLn('Q uit');
  10897.     WriteLn;
  10898.     Write('Your choice: ');
  10899.     REPEAT
  10900.         ReadLn(choice1);
  10901.       IF choice1 <> '1' THEN BEGIN
  10902.           WriteLn('Sorry !');
  10903.          WriteLn('This demo wasn''t written for more as 256 colors !');
  10904.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  10905.          WriteLn('Switching to 256 colors.');
  10906.          choice1 := '1';
  10907.       END;
  10908.     UNTIL choice1 IN ['1'..'4','q'];
  10909.     IF choice1 = 'q' THEN Halt;
  10910.  
  10911.     WriteLn;
  10912.     WriteLn;
  10913.     WriteLn('a. 320x200');
  10914.     WriteLn('b. 640x480');
  10915.     WriteLn('c. 800x600');
  10916.     WriteLn('d. 1024x768');
  10917.     WriteLn('e. 1280x1024');
  10918.     WriteLn('Q uit');
  10919.     WriteLn;
  10920.     Write('Your choice: ');
  10921.     REPEAT
  10922.         ReadLn(choice2);
  10923.     UNTIL choice2 IN ['a'..'e','q'];
  10924.     IF choice2 = 'q' THEN Halt;
  10925.  
  10926.     CASE choice2 OF
  10927.         'a' : BEGIN
  10928.             xsize := 320;
  10929.             ysize := 200;
  10930.         END;
  10931.         'b' : BEGIN
  10932.             xsize := 640;
  10933.             ysize := 480;
  10934.         END;
  10935.         'c' : BEGIN
  10936.             xsize := 800;
  10937.             ysize := 600;
  10938.         END;
  10939.         'd' : BEGIN
  10940.             xsize := 1024;
  10941.             ysize := 768;
  10942.         END;
  10943.         'e' : BEGIN
  10944.             xsize := 1280;
  10945.             ysize := 1024;
  10946.         END;
  10947.     END;
  10948.     CASE choice1 OF
  10949.         '1' : mode := FindVesaMode(xsize,ysize,8);
  10950.         '2' : mode := FindVesaMode(xsize,ysize,15);
  10951.         '3' : mode := FindVesaMode(xsize,ysize,16);
  10952.         '4' : mode := FindVesaMode(xsize,ysize,24);
  10953.     END;
  10954.     IF mode = 0 THEN BEGIN
  10955.         WriteLn('No such mode could be found !');
  10956.         WriteLn('Switching to to 320x200.');
  10957.         ReadKey;
  10958.         mode := V320x200x256;
  10959.     END;
  10960. END;
  10961.  
  10962. begin { program body }
  10963.   SelectMode;
  10964.   Initialize;
  10965.   ReportStatus;
  10966.  
  10967. {  AspectRatioPlay; }
  10968.   FillEllipsePlay;
  10969.   SectorPlay;
  10970.   WriteModePlay;
  10971.  
  10972.   ColorPlay;
  10973.   { PalettePlay only intended to work on these drivers: }
  10974.   if (GraphDriver = EGA) or
  10975.       (GraphDriver = EGA64) or
  10976.       (GraphDriver = VGA) then
  10977.      PalettePlay;
  10978.   PutPixelPlay;
  10979. {  PutImagePlay; }
  10980.   RandBarPlay;
  10981.   BarPlay;
  10982.   Bar3DPlay;
  10983.   ArcPlay;
  10984.   CirclePlay;
  10985.   PiePlay;
  10986.   LineToPlay;
  10987.   LineRelPlay;
  10988. {  LineStylePlay; }
  10989. {  UserLineStylePlay; }
  10990.   TextDump;
  10991.   TextPlay;
  10992.   CrtModePlay;
  10993.   FillStylePlay;
  10994.   FillPatternPlay;
  10995.   PolyPlay;
  10996.   SayGoodbye;
  10997. {  CloseGraph; }
  10998.   CloseVesa;
  10999. end.
  11000. ***************************************************
  11001.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  11002.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  11003. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  11004. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  11005.     Color := RandColor;
  11006.     SetColor(Color);
  11007.     SetFillStyle(Random(CloseDotFill)+1, Color);
  11008.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  11009.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  11010.   until KeyPressed;
  11011.   WaitToGo;
  11012. end; { RandBarPlay }
  11013.  
  11014. procedure ArcPlay;
  11015. { Draw random arcs on the screen }
  11016. var
  11017.   MaxRadius : word;
  11018.   EndAngle : word;
  11019.   ArcInfo : ArcCoordsType;
  11020. begin
  11021.   MainWindow('Arc / GetArcCoords demonstration');
  11022.   StatusLine('Esc aborts or press a key');
  11023.   MaxRadius := MaxY div 10;
  11024.   repeat
  11025.     SetColor(RandColor);
  11026.     EndAngle := Random(360);
  11027.     SetLineStyle(SolidLn, 0, NormWidth);
  11028.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  11029.     GetArcCoords(ArcInfo);
  11030.     with ArcInfo do
  11031.     begin
  11032.       Line(X, Y, XStart, YStart);
  11033.       Line(X, Y, Xend, Yend);
  11034.     end;
  11035.   until KeyPressed;
  11036.   WaitToGo;
  11037. end; { ArcPlay }
  11038.  
  11039. procedure PutPixelPlay;
  11040. { Demonstrate the PutPixel and GetPixel commands }
  11041. const
  11042.   Seed   = 1962; { A seed for the random number generator }
  11043.   NumPts = 2000; { The number of pixels plotted }
  11044.   Esc    = #27;
  11045. var
  11046.   I : word;
  11047.   X, Y, Color : word;
  11048.   XMax, YMax  : integer;
  11049.   ViewInfo    : ViewPortType;
  11050. begin
  11051.   MainWindow('PutPixel / GetPixel demonstration');
  11052.   StatusLine('Esc aborts or press a key...');
  11053.  
  11054.   GetViewSettings(ViewInfo);
  11055.   with ViewInfo do
  11056.   begin
  11057.     XMax := (x2-x1-1);
  11058.     YMax := (y2-y1-1);
  11059.   end;
  11060.  
  11061.   while not KeyPressed do
  11062.   begin
  11063.     { Plot random pixels }
  11064.     RandSeed := Seed;
  11065.     I := 0;
  11066.     while (not KeyPressed) and (I < NumPts) do
  11067.     begin
  11068.       Inc(I);
  11069.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  11070.     end;
  11071.  
  11072.     { Erase pixels }
  11073.     RandSeed := Seed;
  11074.     I := 0;
  11075.     while (not KeyPressed) and (I < NumPts) do
  11076.     begin
  11077.       Inc(I);
  11078.       X := Random(XMax)+1;
  11079.       Y := Random(YMax)+1;
  11080.       Color := GetPixel(X, Y);
  11081.         if Color = RandColor then
  11082.           PutPixel(X, Y, 0);
  11083.      end;
  11084.   end;
  11085.   WaitToGo;
  11086. end; { PutPixelPlay }
  11087.  
  11088. procedure PutImagePlay;
  11089. { Demonstrate the GetImage and PutImage commands }
  11090.  
  11091. const
  11092.   r  = 20;
  11093.   StartX = 100;
  11094.   StartY = 50;
  11095.  
  11096. var
  11097.   CurPort : ViewPortType;
  11098.  
  11099. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  11100. var
  11101.   Step : integer;
  11102. begin
  11103.   Step := Random(2*r);
  11104.   if Odd(Step) then
  11105.     Step := -Step;
  11106.   X := X + Step;
  11107.   Step := Random(r);
  11108.   if Odd(Step) then
  11109.     Step := -Step;
  11110.   Y := Y + Step;
  11111.  
  11112.   { Make saucer bounce off viewport walls }
  11113.   with CurPort do
  11114.   begin
  11115.     if (x1 + X + Width - 1 > x2) then
  11116.       X := x2-x1 - Width + 1
  11117.     else
  11118.       if (X < 0) then
  11119.         X := 0;
  11120.     if (y1 + Y + Height - 1 > y2) then
  11121.       Y := y2-y1 - Height + 1
  11122.     else
  11123.       if (Y < 0) then
  11124.         Y := 0;
  11125.   end;
  11126. end; { MoveSaucer }
  11127.  
  11128. var
  11129.   Pausetime : word;
  11130.   Saucer    : pointer;
  11131.   X, Y      : integer;
  11132.   ulx, uly  : word;
  11133.   lrx, lry  : word;
  11134.   Size      : word;
  11135.   I         : word;
  11136. begin
  11137.   ClearDevice;
  11138.   FullPort;
  11139.  
  11140.   { PaintScreen }
  11141.   ClearDevice;
  11142.   MainWindow('GetImage / PutImage Demonstration');
  11143.   StatusLine('Esc aborts or press a key...');
  11144.   GetViewSettings(CurPort);
  11145.  
  11146.   { DrawSaucer }
  11147.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  11148.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  11149.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  11150.   Circle(StartX+10, StartY-12, 2);
  11151.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  11152.   Circle(StartX-10, StartY-12, 2);
  11153.   SetFillStyle(SolidFill, MaxColor);
  11154.   FloodFill(StartX+1, StartY+4, GetColor);
  11155.  
  11156.   { ReadSaucerImage }
  11157.   ulx := StartX-(r+1);
  11158.   uly := StartY-14;
  11159.   lrx := StartX+(r+1);
  11160.   lry := StartY+(r div 3)+3;
  11161.  
  11162.   Size := ImageSize(ulx, uly, lrx, lry);
  11163.   GetMem(Saucer, Size);
  11164.   GetImage(ulx, uly, lrx, lry, Saucer^);
  11165. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  11166.  
  11167.   { Plot some "stars" }
  11168.   for I := 1 to 1000 do
  11169.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  11170.   X := MaxX div 2;
  11171.   Y := MaxY div 2;
  11172.   PauseTime := 70;
  11173.  
  11174.   { Move the saucer around }
  11175.   repeat
  11176. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  11177.      Delay(PauseTime);
  11178. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  11179.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  11180.   until KeyPressed;
  11181.   FreeMem(Saucer, size);
  11182.   WaitToGo;
  11183. end; { PutImagePlay }
  11184.  
  11185. procedure PolyPlay;
  11186. { Draw random polygons with random fill styles on the screen }
  11187. const
  11188.   MaxPts = 5;
  11189. type
  11190.   PolygonType = array[1..MaxPts] of PointType;
  11191. var
  11192.   Poly : PolygonType;
  11193.   I, Color : word;
  11194. begin
  11195.   MainWindow('FillPoly demonstration');
  11196.   StatusLine('Esc aborts or press a key...');
  11197.   repeat
  11198.     Color := RandColor;
  11199.     SetFillStyle(Random(11)+1, Color);
  11200.     SetColor(Color);
  11201.     for I := 1 to MaxPts do
  11202.       with Poly[I] do
  11203.       begin
  11204.         X := Random(MaxX);
  11205.         Y := Random(MaxY);
  11206.       end;
  11207.     FillPoly(MaxPts, Poly);
  11208.   until KeyPressed;
  11209.   WaitToGo;
  11210. end; { PolyPlay }
  11211.  
  11212. procedure FillStylePlay;
  11213. { Display all of the predefined fill styles available }
  11214. var
  11215.   Style    : word;
  11216.   Width    : word;
  11217.   Height   : word;
  11218.   X, Y     : word;
  11219.   I, J     : word;
  11220.   ViewInfo : ViewPortType;
  11221.  
  11222. procedure DrawBox(X, Y : word);
  11223. begin
  11224.   SetFillStyle(Style, MaxColor);
  11225.   with ViewInfo do
  11226.     Bar(X, Y, X+Width, Y+Height);
  11227.   Rectangle(X, Y, X+Width, Y+Height);
  11228.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  11229.   Inc(Style);
  11230. end; { DrawBox }
  11231.  
  11232. begin
  11233.   MainWindow('Pre-defined fill styles');
  11234.   GetViewSettings(ViewInfo);
  11235.   with ViewInfo do
  11236.   begin
  11237.     Width := 2 * ((x2+1) div 13);
  11238.     Height := 2 * ((y2-10) div 10);
  11239.   end;
  11240.   X := Width div 2;
  11241.   Y := Height div 2;
  11242.   Style := 0;
  11243.   for J := 1 to 3 do
  11244.   begin
  11245.     for I := 1 to 4 do
  11246.     begin
  11247.       DrawBox(X, Y);
  11248.       Inc(X, (Width div 2) * 3);
  11249.     end;
  11250.     X := Width div 2;
  11251.     Inc(Y, (Height div 2) * 3);
  11252.   end;
  11253.   SetTextJustify(LeftText, TopText);
  11254.   WaitToGo;
  11255. end; { FillStylePlay }
  11256.  
  11257. procedure FillPatternPlay;
  11258. { Display some user defined fill patterns }
  11259. const
  11260.   Patterns : array[0..11] of FillPatternType = (
  11261.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  11262.             OldColor which has a path of pixels of OldColor or NewColor
  11263.             with sides touching back to the seed point, (XSeed, YSeed).
  11264.             Therefore, only pixels of OldColor are modified and no other
  11265.             information is changed.
  11266.  
  11267.             SEE ALSO
  11268.  
  11269.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  11270.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  11271.             SETVIEW
  11272.  
  11273.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  11274.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  11275.             IF WHICHVGA = 0 THEN STOP
  11276.             DUMMY=RES640
  11277.             SETVIEW 100, 100, 539, 379
  11278.             FILLVIEW 10
  11279.             WHILE INKEY$ = ""
  11280.             WEND
  11281.             VIDEOMODESET VMODE
  11282.             END
  11283.  
  11284.  
  11285.  
  11286.  
  11287.  
  11288.  
  11289.  
  11290.  
  11291.  
  11292.  
  11293.  
  11294.  
  11295.  
  11296.  
  11297.  
  11298.  
  11299.                                                                          63
  11300.  
  11301.  
  11302.  
  11303.  
  11304.  
  11305.           FONTGETINFO
  11306.  
  11307.             PROTOTYPE
  11308.  
  11309.             SUB FONTGETINFO (Width%, Height%)
  11310.  
  11311.             INPUT
  11312.  
  11313.             no input parameters
  11314.     WEND
  11315.             MOUSEEXIT
  11316.             VIDEOMODESET VMODE
  11317.             END
  11318.  
  11319.  
  11320.  
  11321.  
  11322.  
  11323.  
  11324.  
  11325.  
  11326.  
  11327.  
  11328.  
  11329.  
  11330.  
  11331.  
  11332.  
  11333.  
  11334.  
  11335.  
  11336.  
  11337.  
  11338.  
  11339.  
  11340.  
  11341.  
  11342.  
  11343.  
  11344.  
  11345.  
  11346.  
  11347.  
  11348.  
  11349.  
  11350.  
  11351.  
  11352.  
  11353.  
  11354.  
  11355.  
  11356.  
  11357.  
  11358.                                                                          86
  11359.  
  11360.  
  11361.  
  11362.  
  11363.  
  11364.           MOUSECURSORDEFAULT
  11365.  
  11366.             PROTOTYPE
  11367.  
  11368.             SUB MOUSECURSORDEFAULT ()
  11369.  
  11370.             INPUT
  11371.  
  11372.             no input parameters
  11373.  
  11374.             OUTPUT
  11375.  
  11376.             no value returned
  11377.  
  11378.             USAGE
  11379.  
  11380.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  11381.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  11382. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  11383. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  11384. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  11385. $╤
  11386. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  11387. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  11388. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  11389.       end;
  11390.     end;
  11391.   end;
  11392.   WaitToGo;
  11393. end; { UserLineStylePlay }
  11394.  
  11395.  
  11396. procedure SayGoodbye;
  11397. { Say goodbye and then exit the program }
  11398. var
  11399.   ViewInfo : ViewPortType;
  11400. begin
  11401.   MainWindow('');
  11402.   GetViewSettings(ViewInfo);
  11403.   SetTextStyle(TriplexFont, HorizDir, 4);
  11404.   SetTextJustify(CenterText, CenterText);
  11405.   with ViewInfo do
  11406.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  11407.   StatusLine('Press any key to quit...');
  11408.   repeat until KeyPressed;
  11409. end; { SayGoodbye }
  11410.  
  11411.  
  11412. PROCEDURE SelectMode;
  11413. VAR
  11414.     choice1,choice2     : CHAR;
  11415.    xsize,ysize            : WORD;
  11416. BEGIN
  11417.     (* Let's select a mode *)
  11418.     ClrScr;
  11419.     WriteLn('VESADEMO:');
  11420.     WriteLn('1. 256 colors');
  11421.     WriteLn('2. 32768 colors');
  11422.     WriteLn('3. 65536 colors');
  11423.     WriteLn('4. 16777216 colors');
  11424.     WriteLn('Q uit');
  11425.     WriteLn;
  11426.     Write('Your choice: ');
  11427.     REPEAT
  11428.         ReadLn(choice1);
  11429.       IF choice1 <> '1' THEN BEGIN
  11430.           WriteLn('Sorry !');
  11431.          WriteLn('This demo wasn''t written for more as 256 colors !');
  11432.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  11433.          WriteLn('Switching to 256 colors.');
  11434.          choice1 := '1';
  11435.       END;
  11436.     UNTIL choice1 IN ['1'..'4','q'];
  11437.     IF choice1 = 'q' THEN Halt;
  11438.  
  11439.     WriteLn;
  11440.     WriteLn;
  11441.     WriteLn('a. 320x200');
  11442.     WriteLn('b. 640x480');
  11443.     WriteLn('c. 800x600');
  11444.     WriteLn('d. 1024x768');
  11445.     WriteLn('e. 1280x1024');
  11446.     WriteLn('Q uit');
  11447.     WriteLn;
  11448.     Write('Your choice: ');
  11449.     REPEAT
  11450.         ReadLn(choice2);
  11451.     UNTIL choice2 IN ['a'..'e','q'];
  11452.     IF choice2 = 'q' THEN Halt;
  11453.  
  11454.     CASE choice2 OF
  11455.         'a' : BEGIN
  11456.             xsize := 320;
  11457.             ysize := 200;
  11458.         END;
  11459.         'b' : BEGIN
  11460.             xsize := 640;
  11461.             ysize := 480;
  11462.         END;
  11463.         'c' : BEGIN
  11464.             xsize := 800;
  11465.             ysize := 600;
  11466.         END;
  11467.         'd' : BEGIN
  11468.             xsize := 1024;
  11469.             ysize := 768;
  11470.         END;
  11471.         'e' : BEGIN
  11472.             xsize := 1280;
  11473.             ysize := 1024;
  11474.         END;
  11475.     END;
  11476.     CASE choice1 OF
  11477.         '1' : mode := FindVesaMode(xsize,ysize,8);
  11478.         '2' : mode := FindVesaMode(xsize,ysize,15);
  11479.         '3' : mode := FindVesaMode(xsize,ysize,16);
  11480.         '4' : mode := FindVesaMode(xsize,ysize,24);
  11481.     END;
  11482.     IF mode = 0 THEN BEGIN
  11483.         WriteLn('No such mode could be found !');
  11484.         WriteLn('Switching to to 320x200.');
  11485.         ReadKey;
  11486.         mode := V320x200x256;
  11487.     END;
  11488. END;
  11489.  
  11490. begin { program body }
  11491.   SelectMode;
  11492.   Initialize;
  11493.   ReportStatus;
  11494.  
  11495. {  AspectRatioPlay; }
  11496.   FillEllipsePlay;
  11497.   SectorPlay;
  11498.   WriteModePlay;
  11499.  
  11500.   ColorPlay;
  11501.   { PalettePlay only intended to work on these drivers: }
  11502.   if (GraphDriver = EGA) or
  11503.       (GraphDriver = EGA64) or
  11504.       (GraphDriver = VGA) then
  11505.      PalettePlay;
  11506.   PutPixelPlay;
  11507. {  PutImagePlay; }
  11508.   RandBarPlay;
  11509.   BarPlay;
  11510.   Bar3DPlay;
  11511.   ArcPlay;
  11512.   CirclePlay;
  11513.   PiePlay;
  11514.   LineToPlay;
  11515.   LineRelPlay;
  11516. {  LineStylePlay; }
  11517. {  UserLineStylePlay; }
  11518.   TextDump;
  11519.   TextPlay;
  11520.   CrtModePlay;
  11521.   FillStylePlay;
  11522.   FillPatternPlay;
  11523.   PolyPlay;
  11524.   SayGoodbye;
  11525. {  CloseGraph; }
  11526.   CloseVesa;
  11527. end.
  11528. ***************************************************
  11529.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  11530.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  11531. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  11532. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  11533.     Color := RandColor;
  11534.     SetColor(Color);
  11535.     SetFillStyle(Random(CloseDotFill)+1, Color);
  11536.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  11537.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  11538.   until KeyPressed;
  11539.   WaitToGo;
  11540. end; { RandBarPlay }
  11541.  
  11542. procedure ArcPlay;
  11543. { Draw random arcs on the screen }
  11544. var
  11545.   MaxRadius : word;
  11546.   EndAngle : word;
  11547.   ArcInfo : ArcCoordsType;
  11548. begin
  11549.   MainWindow('Arc / GetArcCoords demonstration');
  11550.   StatusLine('Esc aborts or press a key');
  11551.   MaxRadius := MaxY div 10;
  11552.   repeat
  11553.     SetColor(RandColor);
  11554.     EndAngle := Random(360);
  11555.     SetLineStyle(SolidLn, 0, NormWidth);
  11556.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  11557.     GetArcCoords(ArcInfo);
  11558.     with ArcInfo do
  11559.     begin
  11560.       Line(X, Y, XStart, YStart);
  11561.       Line(X, Y, Xend, Yend);
  11562.     end;
  11563.   until KeyPressed;
  11564.   WaitToGo;
  11565. end; { ArcPlay }
  11566.  
  11567. procedure PutPixelPlay;
  11568. { Demonstrate the PutPixel and GetPixel commands }
  11569. const
  11570.   Seed   = 1962; { A seed for the random number generator }
  11571.   NumPts = 2000; { The number of pixels plotted }
  11572.   Esc    = #27;
  11573. var
  11574.   I : word;
  11575.   X, Y, Color : word;
  11576.   XMax, YMax  : integer;
  11577.   ViewInfo    : ViewPortType;
  11578. begin
  11579.   MainWindow('PutPixel / GetPixel demonstration');
  11580.   StatusLine('Esc aborts or press a key...');
  11581.  
  11582.   GetViewSettings(ViewInfo);
  11583.   with ViewInfo do
  11584.   begin
  11585.     XMax := (x2-x1-1);
  11586.     YMax := (y2-y1-1);
  11587.   end;
  11588.  
  11589.   while not KeyPressed do
  11590.   begin
  11591.     { Plot random pixels }
  11592.     RandSeed := Seed;
  11593.     I := 0;
  11594.     while (not KeyPressed) and (I < NumPts) do
  11595.     begin
  11596.       Inc(I);
  11597.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  11598.     end;
  11599.  
  11600.     { Erase pixels }
  11601.     RandSeed := Seed;
  11602.     I := 0;
  11603.     while (not KeyPressed) and (I < NumPts) do
  11604.     begin
  11605.       Inc(I);
  11606.       X := Random(XMax)+1;
  11607.       Y := Random(YMax)+1;
  11608.       Color := GetPixel(X, Y);
  11609.         if Color = RandColor then
  11610.           PutPixel(X, Y, 0);
  11611.      end;
  11612.   end;
  11613.   WaitToGo;
  11614. end; { PutPixelPlay }
  11615.  
  11616. procedure PutImagePlay;
  11617. { Demonstrate the GetImage and PutImage commands }
  11618.  
  11619. const
  11620.   r  = 20;
  11621.   StartX = 100;
  11622.   StartY = 50;
  11623.  
  11624. var
  11625.   CurPort : ViewPortType;
  11626.  
  11627. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  11628. var
  11629.   Step : integer;
  11630. begin
  11631.   Step := Random(2*r);
  11632.   if Odd(Step) then
  11633.     Step := -Step;
  11634.   X := X + Step;
  11635.   Step := Random(r);
  11636.   if Odd(Step) then
  11637.     Step := -Step;
  11638.   Y := Y + Step;
  11639.  
  11640.   { Make saucer bounce off viewport walls }
  11641.   with CurPort do
  11642.   begin
  11643.     if (x1 + X + Width - 1 > x2) then
  11644.       X := x2-x1 - Width + 1
  11645.     else
  11646.       if (X < 0) then
  11647.         X := 0;
  11648.     if (y1 + Y + Height - 1 > y2) then
  11649.       Y := y2-y1 - Height + 1
  11650.     else
  11651.       if (Y < 0) then
  11652.         Y := 0;
  11653.   end;
  11654. end; { MoveSaucer }
  11655.  
  11656. var
  11657.   Pausetime : word;
  11658.   Saucer    : pointer;
  11659.   X, Y      : integer;
  11660.   ulx, uly  : word;
  11661.   lrx, lry  : word;
  11662.   Size      : word;
  11663.   I         : word;
  11664. begin
  11665.   ClearDevice;
  11666.   FullPort;
  11667.  
  11668.   { PaintScreen }
  11669.   ClearDevice;
  11670.   MainWindow('GetImage / PutImage Demonstration');
  11671.   StatusLine('Esc aborts or press a key...');
  11672.   GetViewSettings(CurPort);
  11673.  
  11674.   { DrawSaucer }
  11675.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  11676.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  11677.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  11678.   Circle(StartX+10, StartY-12, 2);
  11679.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  11680.   Circle(StartX-10, StartY-12, 2);
  11681.   SetFillStyle(SolidFill, MaxColor);
  11682.   FloodFill(StartX+1, StartY+4, GetColor);
  11683.  
  11684.   { ReadSaucerImage }
  11685.   ulx := StartX-(r+1);
  11686.   uly := StartY-14;
  11687.   lrx := StartX+(r+1);
  11688.   lry := StartY+(r div 3)+3;
  11689.  
  11690.   Size := ImageSize(ulx, uly, lrx, lry);
  11691.   GetMem(Saucer, Size);
  11692.   GetImage(ulx, uly, lrx, lry, Saucer^);
  11693. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  11694.  
  11695.   { Plot some "stars" }
  11696.   for I := 1 to 1000 do
  11697.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  11698.   X := MaxX div 2;
  11699.   Y := MaxY div 2;
  11700.   PauseTime := 70;
  11701.  
  11702.   { Move the saucer around }
  11703.   repeat
  11704. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  11705.      Delay(PauseTime);
  11706. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  11707.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  11708.   until KeyPressed;
  11709.   FreeMem(Saucer, size);
  11710.   WaitToGo;
  11711. end; { PutImagePlay }
  11712.  
  11713. procedure PolyPlay;
  11714. { Draw random polygons with random fill styles on the screen }
  11715. const
  11716.   MaxPts = 5;
  11717. type
  11718.   PolygonType = array[1..MaxPts] of PointType;
  11719. var
  11720.   Poly : PolygonType;
  11721.   I, Color : word;
  11722. begin
  11723.   MainWindow('FillPoly demonstration');
  11724.   StatusLine('Esc aborts or press a key...');
  11725.   repeat
  11726.     Color := RandColor;
  11727.     SetFillStyle(Random(11)+1, Color);
  11728.     SetColor(Color);
  11729.     for I := 1 to MaxPts do
  11730.       with Poly[I] do
  11731.       begin
  11732.         X := Random(MaxX);
  11733.         Y := Random(MaxY);
  11734.       end;
  11735.     FillPoly(MaxPts, Poly);
  11736.   until KeyPressed;
  11737.   WaitToGo;
  11738. end; { PolyPlay }
  11739.  
  11740. procedure FillStylePlay;
  11741. { Display all of the predefined fill styles available }
  11742. var
  11743.   Style    : word;
  11744.   Width    : word;
  11745.   Height   : word;
  11746.   X, Y     : word;
  11747.   I, J     : word;
  11748.   ViewInfo : ViewPortType;
  11749.  
  11750. procedure DrawBox(X, Y : word);
  11751. begin
  11752.   SetFillStyle(Style, MaxColor);
  11753.   with ViewInfo do
  11754.     Bar(X, Y, X+Width, Y+Height);
  11755.   Rectangle(X, Y, X+Width, Y+Height);
  11756.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  11757.   Inc(Style);
  11758. end; { DrawBox }
  11759.  
  11760. begin
  11761.   MainWindow('Pre-defined fill styles');
  11762.   GetViewSettings(ViewInfo);
  11763.   with ViewInfo do
  11764.   begin
  11765.     Width := 2 * ((x2+1) div 13);
  11766.     Height := 2 * ((y2-10) div 10);
  11767.   end;
  11768.   X := Width div 2;
  11769.   Y := Height div 2;
  11770.   Style := 0;
  11771.   for J := 1 to 3 do
  11772.   begin
  11773.     for I := 1 to 4 do
  11774.     begin
  11775.       DrawBox(X, Y);
  11776.       Inc(X, (Width div 2) * 3);
  11777.     end;
  11778.     X := Width div 2;
  11779.     Inc(Y, (Height div 2) * 3);
  11780.   end;
  11781.   SetTextJustify(LeftText, TopText);
  11782.   WaitToGo;
  11783. end; { FillStylePlay }
  11784.  
  11785. procedure FillPatternPlay;
  11786. { Display some user defined fill patterns }
  11787. const
  11788.   Patterns : array[0..11] of FillPatternType = (
  11789.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  11790.             OldColor which has a path of pixels of OldColor or NewColor
  11791.             with sides touching back to the seed point, (XSeed, YSeed).
  11792.             Therefore, only pixels of OldColor are modified and no other
  11793.             information is changed.
  11794.  
  11795.             SEE ALSO
  11796.  
  11797.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  11798.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  11799.             SETVIEW
  11800.  
  11801.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  11802.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  11803.             IF WHICHVGA = 0 THEN STOP
  11804.             DUMMY=RES640
  11805.             SETVIEW 100, 100, 539, 379
  11806.             FILLVIEW 10
  11807.             WHILE INKEY$ = ""
  11808.             WEND
  11809.             VIDEOMODESET VMODE
  11810.             END
  11811.  
  11812.  
  11813.  
  11814.  
  11815.  
  11816.  
  11817.  
  11818.  
  11819.  
  11820.  
  11821.  
  11822.  
  11823.  
  11824.  
  11825.  
  11826.  
  11827.                                                                          63
  11828.  
  11829.  
  11830.  
  11831.  
  11832.  
  11833.           FONTGETINFO
  11834.  
  11835.             PROTOTYPE
  11836.  
  11837.             SUB FONTGETINFO (Width%, Height%)
  11838.  
  11839.             INPUT
  11840.  
  11841.             no input parameters
  11842.     WEND
  11843.             MOUSEEXIT
  11844.             VIDEOMODESET VMODE
  11845.             END
  11846.  
  11847.  
  11848.  
  11849.  
  11850.  
  11851.  
  11852.  
  11853.  
  11854.  
  11855.  
  11856.  
  11857.  
  11858.  
  11859.  
  11860.  
  11861.  
  11862.  
  11863.  
  11864.  
  11865.  
  11866.  
  11867.  
  11868.  
  11869.  
  11870.  
  11871.  
  11872.  
  11873.  
  11874.  
  11875.  
  11876.  
  11877.  
  11878.  
  11879.  
  11880.  
  11881.  
  11882.  
  11883.  
  11884.  
  11885.  
  11886.                                                                          86
  11887.  
  11888.  
  11889.  
  11890.  
  11891.  
  11892.           MOUSECURSORDEFAULT
  11893.  
  11894.             PROTOTYPE
  11895.  
  11896.             SUB MOUSECURSORDEFAULT ()
  11897.  
  11898.             INPUT
  11899.  
  11900.             no input parameters
  11901.  
  11902.             OUTPUT
  11903.  
  11904.             no value returned
  11905.  
  11906.             USAGE
  11907.  
  11908.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  11909.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  11910. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  11911. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  11912. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  11913. $╤
  11914. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  11915. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  11916. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  11917.       end;
  11918.     end;
  11919.   end;
  11920.   WaitToGo;
  11921. end; { UserLineStylePlay }
  11922.  
  11923.  
  11924. procedure SayGoodbye;
  11925. { Say goodbye and then exit the program }
  11926. var
  11927.   ViewInfo : ViewPortType;
  11928. begin
  11929.   MainWindow('');
  11930.   GetViewSettings(ViewInfo);
  11931.   SetTextStyle(TriplexFont, HorizDir, 4);
  11932.   SetTextJustify(CenterText, CenterText);
  11933.   with ViewInfo do
  11934.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  11935.   StatusLine('Press any key to quit...');
  11936.   repeat until KeyPressed;
  11937. end; { SayGoodbye }
  11938.  
  11939.  
  11940. PROCEDURE SelectMode;
  11941. VAR
  11942.     choice1,choice2     : CHAR;
  11943.    xsize,ysize            : WORD;
  11944. BEGIN
  11945.     (* Let's select a mode *)
  11946.     ClrScr;
  11947.     WriteLn('VESADEMO:');
  11948.     WriteLn('1. 256 colors');
  11949.     WriteLn('2. 32768 colors');
  11950.     WriteLn('3. 65536 colors');
  11951.     WriteLn('4. 16777216 colors');
  11952.     WriteLn('Q uit');
  11953.     WriteLn;
  11954.     Write('Your choice: ');
  11955.     REPEAT
  11956.         ReadLn(choice1);
  11957.       IF choice1 <> '1' THEN BEGIN
  11958.           WriteLn('Sorry !');
  11959.          WriteLn('This demo wasn''t written for more as 256 colors !');
  11960.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  11961.          WriteLn('Switching to 256 colors.');
  11962.          choice1 := '1';
  11963.       END;
  11964.     UNTIL choice1 IN ['1'..'4','q'];
  11965.     IF choice1 = 'q' THEN Halt;
  11966.  
  11967.     WriteLn;
  11968.     WriteLn;
  11969.     WriteLn('a. 320x200');
  11970.     WriteLn('b. 640x480');
  11971.     WriteLn('c. 800x600');
  11972.     WriteLn('d. 1024x768');
  11973.     WriteLn('e. 1280x1024');
  11974.     WriteLn('Q uit');
  11975.     WriteLn;
  11976.     Write('Your choice: ');
  11977.     REPEAT
  11978.         ReadLn(choice2);
  11979.     UNTIL choice2 IN ['a'..'e','q'];
  11980.     IF choice2 = 'q' THEN Halt;
  11981.  
  11982.     CASE choice2 OF
  11983.         'a' : BEGIN
  11984.             xsize := 320;
  11985.             ysize := 200;
  11986.         END;
  11987.         'b' : BEGIN
  11988.             xsize := 640;
  11989.             ysize := 480;
  11990.         END;
  11991.         'c' : BEGIN
  11992.             xsize := 800;
  11993.             ysize := 600;
  11994.         END;
  11995.         'd' : BEGIN
  11996.             xsize := 1024;
  11997.             ysize := 768;
  11998.         END;
  11999.         'e' : BEGIN
  12000.             xsize := 1280;
  12001.             ysize := 1024;
  12002.         END;
  12003.     END;
  12004.     CASE choice1 OF
  12005.         '1' : mode := FindVesaMode(xsize,ysize,8);
  12006.         '2' : mode := FindVesaMode(xsize,ysize,15);
  12007.         '3' : mode := FindVesaMode(xsize,ysize,16);
  12008.         '4' : mode := FindVesaMode(xsize,ysize,24);
  12009.     END;
  12010.     IF mode = 0 THEN BEGIN
  12011.         WriteLn('No such mode could be found !');
  12012.         WriteLn('Switching to to 320x200.');
  12013.         ReadKey;
  12014.         mode := V320x200x256;
  12015.     END;
  12016. END;
  12017.  
  12018. begin { program body }
  12019.   SelectMode;
  12020.   Initialize;
  12021.   ReportStatus;
  12022.  
  12023. {  AspectRatioPlay; }
  12024.   FillEllipsePlay;
  12025.   SectorPlay;
  12026.   WriteModePlay;
  12027.  
  12028.   ColorPlay;
  12029.   { PalettePlay only intended to work on these drivers: }
  12030.   if (GraphDriver = EGA) or
  12031.       (GraphDriver = EGA64) or
  12032.       (GraphDriver = VGA) then
  12033.      PalettePlay;
  12034.   PutPixelPlay;
  12035. {  PutImagePlay; }
  12036.   RandBarPlay;
  12037.   BarPlay;
  12038.   Bar3DPlay;
  12039.   ArcPlay;
  12040.   CirclePlay;
  12041.   PiePlay;
  12042.   LineToPlay;
  12043.   LineRelPlay;
  12044. {  LineStylePlay; }
  12045. {  UserLineStylePlay; }
  12046.   TextDump;
  12047.   TextPlay;
  12048.   CrtModePlay;
  12049.   FillStylePlay;
  12050.   FillPatternPlay;
  12051.   PolyPlay;
  12052.   SayGoodbye;
  12053. {  CloseGraph; }
  12054.   CloseVesa;
  12055. end.
  12056. ***************************************************
  12057.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  12058.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  12059. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  12060. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  12061.     Color := RandColor;
  12062.     SetColor(Color);
  12063.     SetFillStyle(Random(CloseDotFill)+1, Color);
  12064.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  12065.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  12066.   until KeyPressed;
  12067.   WaitToGo;
  12068. end; { RandBarPlay }
  12069.  
  12070. procedure ArcPlay;
  12071. { Draw random arcs on the screen }
  12072. var
  12073.   MaxRadius : word;
  12074.   EndAngle : word;
  12075.   ArcInfo : ArcCoordsType;
  12076. begin
  12077.   MainWindow('Arc / GetArcCoords demonstration');
  12078.   StatusLine('Esc aborts or press a key');
  12079.   MaxRadius := MaxY div 10;
  12080.   repeat
  12081.     SetColor(RandColor);
  12082.     EndAngle := Random(360);
  12083.     SetLineStyle(SolidLn, 0, NormWidth);
  12084.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  12085.     GetArcCoords(ArcInfo);
  12086.     with ArcInfo do
  12087.     begin
  12088.       Line(X, Y, XStart, YStart);
  12089.       Line(X, Y, Xend, Yend);
  12090.     end;
  12091.   until KeyPressed;
  12092.   WaitToGo;
  12093. end; { ArcPlay }
  12094.  
  12095. procedure PutPixelPlay;
  12096. { Demonstrate the PutPixel and GetPixel commands }
  12097. const
  12098.   Seed   = 1962; { A seed for the random number generator }
  12099.   NumPts = 2000; { The number of pixels plotted }
  12100.   Esc    = #27;
  12101. var
  12102.   I : word;
  12103.   X, Y, Color : word;
  12104.   XMax, YMax  : integer;
  12105.   ViewInfo    : ViewPortType;
  12106. begin
  12107.   MainWindow('PutPixel / GetPixel demonstration');
  12108.   StatusLine('Esc aborts or press a key...');
  12109.  
  12110.   GetViewSettings(ViewInfo);
  12111.   with ViewInfo do
  12112.   begin
  12113.     XMax := (x2-x1-1);
  12114.     YMax := (y2-y1-1);
  12115.   end;
  12116.  
  12117.   while not KeyPressed do
  12118.   begin
  12119.     { Plot random pixels }
  12120.     RandSeed := Seed;
  12121.     I := 0;
  12122.     while (not KeyPressed) and (I < NumPts) do
  12123.     begin
  12124.       Inc(I);
  12125.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  12126.     end;
  12127.  
  12128.     { Erase pixels }
  12129.     RandSeed := Seed;
  12130.     I := 0;
  12131.     while (not KeyPressed) and (I < NumPts) do
  12132.     begin
  12133.       Inc(I);
  12134.       X := Random(XMax)+1;
  12135.       Y := Random(YMax)+1;
  12136.       Color := GetPixel(X, Y);
  12137.         if Color = RandColor then
  12138.           PutPixel(X, Y, 0);
  12139.      end;
  12140.   end;
  12141.   WaitToGo;
  12142. end; { PutPixelPlay }
  12143.  
  12144. procedure PutImagePlay;
  12145. { Demonstrate the GetImage and PutImage commands }
  12146.  
  12147. const
  12148.   r  = 20;
  12149.   StartX = 100;
  12150.   StartY = 50;
  12151.  
  12152. var
  12153.   CurPort : ViewPortType;
  12154.  
  12155. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  12156. var
  12157.   Step : integer;
  12158. begin
  12159.   Step := Random(2*r);
  12160.   if Odd(Step) then
  12161.     Step := -Step;
  12162.   X := X + Step;
  12163.   Step := Random(r);
  12164.   if Odd(Step) then
  12165.     Step := -Step;
  12166.   Y := Y + Step;
  12167.  
  12168.   { Make saucer bounce off viewport walls }
  12169.   with CurPort do
  12170.   begin
  12171.     if (x1 + X + Width - 1 > x2) then
  12172.       X := x2-x1 - Width + 1
  12173.     else
  12174.       if (X < 0) then
  12175.         X := 0;
  12176.     if (y1 + Y + Height - 1 > y2) then
  12177.       Y := y2-y1 - Height + 1
  12178.     else
  12179.       if (Y < 0) then
  12180.         Y := 0;
  12181.   end;
  12182. end; { MoveSaucer }
  12183.  
  12184. var
  12185.   Pausetime : word;
  12186.   Saucer    : pointer;
  12187.   X, Y      : integer;
  12188.   ulx, uly  : word;
  12189.   lrx, lry  : word;
  12190.   Size      : word;
  12191.   I         : word;
  12192. begin
  12193.   ClearDevice;
  12194.   FullPort;
  12195.  
  12196.   { PaintScreen }
  12197.   ClearDevice;
  12198.   MainWindow('GetImage / PutImage Demonstration');
  12199.   StatusLine('Esc aborts or press a key...');
  12200.   GetViewSettings(CurPort);
  12201.  
  12202.   { DrawSaucer }
  12203.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  12204.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  12205.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  12206.   Circle(StartX+10, StartY-12, 2);
  12207.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  12208.   Circle(StartX-10, StartY-12, 2);
  12209.   SetFillStyle(SolidFill, MaxColor);
  12210.   FloodFill(StartX+1, StartY+4, GetColor);
  12211.  
  12212.   { ReadSaucerImage }
  12213.   ulx := StartX-(r+1);
  12214.   uly := StartY-14;
  12215.   lrx := StartX+(r+1);
  12216.   lry := StartY+(r div 3)+3;
  12217.  
  12218.   Size := ImageSize(ulx, uly, lrx, lry);
  12219.   GetMem(Saucer, Size);
  12220.   GetImage(ulx, uly, lrx, lry, Saucer^);
  12221. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  12222.  
  12223.   { Plot some "stars" }
  12224.   for I := 1 to 1000 do
  12225.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  12226.   X := MaxX div 2;
  12227.   Y := MaxY div 2;
  12228.   PauseTime := 70;
  12229.  
  12230.   { Move the saucer around }
  12231.   repeat
  12232. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  12233.      Delay(PauseTime);
  12234. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  12235.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  12236.   until KeyPressed;
  12237.   FreeMem(Saucer, size);
  12238.   WaitToGo;
  12239. end; { PutImagePlay }
  12240.  
  12241. procedure PolyPlay;
  12242. { Draw random polygons with random fill styles on the screen }
  12243. const
  12244.   MaxPts = 5;
  12245. type
  12246.   PolygonType = array[1..MaxPts] of PointType;
  12247. var
  12248.   Poly : PolygonType;
  12249.   I, Color : word;
  12250. begin
  12251.   MainWindow('FillPoly demonstration');
  12252.   StatusLine('Esc aborts or press a key...');
  12253.   repeat
  12254.     Color := RandColor;
  12255.     SetFillStyle(Random(11)+1, Color);
  12256.     SetColor(Color);
  12257.     for I := 1 to MaxPts do
  12258.       with Poly[I] do
  12259.       begin
  12260.         X := Random(MaxX);
  12261.         Y := Random(MaxY);
  12262.       end;
  12263.     FillPoly(MaxPts, Poly);
  12264.   until KeyPressed;
  12265.   WaitToGo;
  12266. end; { PolyPlay }
  12267.  
  12268. procedure FillStylePlay;
  12269. { Display all of the predefined fill styles available }
  12270. var
  12271.   Style    : word;
  12272.   Width    : word;
  12273.   Height   : word;
  12274.   X, Y     : word;
  12275.   I, J     : word;
  12276.   ViewInfo : ViewPortType;
  12277.  
  12278. procedure DrawBox(X, Y : word);
  12279. begin
  12280.   SetFillStyle(Style, MaxColor);
  12281.   with ViewInfo do
  12282.     Bar(X, Y, X+Width, Y+Height);
  12283.   Rectangle(X, Y, X+Width, Y+Height);
  12284.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  12285.   Inc(Style);
  12286. end; { DrawBox }
  12287.  
  12288. begin
  12289.   MainWindow('Pre-defined fill styles');
  12290.   GetViewSettings(ViewInfo);
  12291.   with ViewInfo do
  12292.   begin
  12293.     Width := 2 * ((x2+1) div 13);
  12294.     Height := 2 * ((y2-10) div 10);
  12295.   end;
  12296.   X := Width div 2;
  12297.   Y := Height div 2;
  12298.   Style := 0;
  12299.   for J := 1 to 3 do
  12300.   begin
  12301.     for I := 1 to 4 do
  12302.     begin
  12303.       DrawBox(X, Y);
  12304.       Inc(X, (Width div 2) * 3);
  12305.     end;
  12306.     X := Width div 2;
  12307.     Inc(Y, (Height div 2) * 3);
  12308.   end;
  12309.   SetTextJustify(LeftText, TopText);
  12310.   WaitToGo;
  12311. end; { FillStylePlay }
  12312.  
  12313. procedure FillPatternPlay;
  12314. { Display some user defined fill patterns }
  12315. const
  12316.   Patterns : array[0..11] of FillPatternType = (
  12317.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  12318.             OldColor which has a path of pixels of OldColor or NewColor
  12319.             with sides touching back to the seed point, (XSeed, YSeed).
  12320.             Therefore, only pixels of OldColor are modified and no other
  12321.             information is changed.
  12322.  
  12323.             SEE ALSO
  12324.  
  12325.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  12326.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  12327.             SETVIEW
  12328.  
  12329.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  12330.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  12331.             IF WHICHVGA = 0 THEN STOP
  12332.             DUMMY=RES640
  12333.             SETVIEW 100, 100, 539, 379
  12334.             FILLVIEW 10
  12335.             WHILE INKEY$ = ""
  12336.             WEND
  12337.             VIDEOMODESET VMODE
  12338.             END
  12339.  
  12340.  
  12341.  
  12342.  
  12343.  
  12344.  
  12345.  
  12346.  
  12347.  
  12348.  
  12349.  
  12350.  
  12351.  
  12352.  
  12353.  
  12354.  
  12355.                                                                          63
  12356.  
  12357.  
  12358.  
  12359.  
  12360.  
  12361.           FONTGETINFO
  12362.  
  12363.             PROTOTYPE
  12364.  
  12365.             SUB FONTGETINFO (Width%, Height%)
  12366.  
  12367.             INPUT
  12368.  
  12369.             no input parameters
  12370.     WEND
  12371.             MOUSEEXIT
  12372.             VIDEOMODESET VMODE
  12373.             END
  12374.  
  12375.  
  12376.  
  12377.  
  12378.  
  12379.  
  12380.  
  12381.  
  12382.  
  12383.  
  12384.  
  12385.  
  12386.  
  12387.  
  12388.  
  12389.  
  12390.  
  12391.  
  12392.  
  12393.  
  12394.  
  12395.  
  12396.  
  12397.  
  12398.  
  12399.  
  12400.  
  12401.  
  12402.  
  12403.  
  12404.  
  12405.  
  12406.  
  12407.  
  12408.  
  12409.  
  12410.  
  12411.  
  12412.  
  12413.  
  12414.                                                                          86
  12415.  
  12416.  
  12417.  
  12418.  
  12419.  
  12420.           MOUSECURSORDEFAULT
  12421.  
  12422.             PROTOTYPE
  12423.  
  12424.             SUB MOUSECURSORDEFAULT ()
  12425.  
  12426.             INPUT
  12427.  
  12428.             no input parameters
  12429.  
  12430.             OUTPUT
  12431.  
  12432.             no value returned
  12433.  
  12434.             USAGE
  12435.  
  12436.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  12437.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  12438. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  12439. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  12440. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  12441. $╤
  12442. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  12443. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  12444. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  12445.       end;
  12446.     end;
  12447.   end;
  12448.   WaitToGo;
  12449. end; { UserLineStylePlay }
  12450.  
  12451.  
  12452. procedure SayGoodbye;
  12453. { Say goodbye and then exit the program }
  12454. var
  12455.   ViewInfo : ViewPortType;
  12456. begin
  12457.   MainWindow('');
  12458.   GetViewSettings(ViewInfo);
  12459.   SetTextStyle(TriplexFont, HorizDir, 4);
  12460.   SetTextJustify(CenterText, CenterText);
  12461.   with ViewInfo do
  12462.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  12463.   StatusLine('Press any key to quit...');
  12464.   repeat until KeyPressed;
  12465. end; { SayGoodbye }
  12466.  
  12467.  
  12468. PROCEDURE SelectMode;
  12469. VAR
  12470.     choice1,choice2     : CHAR;
  12471.    xsize,ysize            : WORD;
  12472. BEGIN
  12473.     (* Let's select a mode *)
  12474.     ClrScr;
  12475.     WriteLn('VESADEMO:');
  12476.     WriteLn('1. 256 colors');
  12477.     WriteLn('2. 32768 colors');
  12478.     WriteLn('3. 65536 colors');
  12479.     WriteLn('4. 16777216 colors');
  12480.     WriteLn('Q uit');
  12481.     WriteLn;
  12482.     Write('Your choice: ');
  12483.     REPEAT
  12484.         ReadLn(choice1);
  12485.       IF choice1 <> '1' THEN BEGIN
  12486.           WriteLn('Sorry !');
  12487.          WriteLn('This demo wasn''t written for more as 256 colors !');
  12488.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  12489.          WriteLn('Switching to 256 colors.');
  12490.          choice1 := '1';
  12491.       END;
  12492.     UNTIL choice1 IN ['1'..'4','q'];
  12493.     IF choice1 = 'q' THEN Halt;
  12494.  
  12495.     WriteLn;
  12496.     WriteLn;
  12497.     WriteLn('a. 320x200');
  12498.     WriteLn('b. 640x480');
  12499.     WriteLn('c. 800x600');
  12500.     WriteLn('d. 1024x768');
  12501.     WriteLn('e. 1280x1024');
  12502.     WriteLn('Q uit');
  12503.     WriteLn;
  12504.     Write('Your choice: ');
  12505.     REPEAT
  12506.         ReadLn(choice2);
  12507.     UNTIL choice2 IN ['a'..'e','q'];
  12508.     IF choice2 = 'q' THEN Halt;
  12509.  
  12510.     CASE choice2 OF
  12511.         'a' : BEGIN
  12512.             xsize := 320;
  12513.             ysize := 200;
  12514.         END;
  12515.         'b' : BEGIN
  12516.             xsize := 640;
  12517.             ysize := 480;
  12518.         END;
  12519.         'c' : BEGIN
  12520.             xsize := 800;
  12521.             ysize := 600;
  12522.         END;
  12523.         'd' : BEGIN
  12524.             xsize := 1024;
  12525.             ysize := 768;
  12526.         END;
  12527.         'e' : BEGIN
  12528.             xsize := 1280;
  12529.             ysize := 1024;
  12530.         END;
  12531.     END;
  12532.     CASE choice1 OF
  12533.         '1' : mode := FindVesaMode(xsize,ysize,8);
  12534.         '2' : mode := FindVesaMode(xsize,ysize,15);
  12535.         '3' : mode := FindVesaMode(xsize,ysize,16);
  12536.         '4' : mode := FindVesaMode(xsize,ysize,24);
  12537.     END;
  12538.     IF mode = 0 THEN BEGIN
  12539.         WriteLn('No such mode could be found !');
  12540.         WriteLn('Switching to to 320x200.');
  12541.         ReadKey;
  12542.         mode := V320x200x256;
  12543.     END;
  12544. END;
  12545.  
  12546. begin { program body }
  12547.   SelectMode;
  12548.   Initialize;
  12549.   ReportStatus;
  12550.  
  12551. {  AspectRatioPlay; }
  12552.   FillEllipsePlay;
  12553.   SectorPlay;
  12554.   WriteModePlay;
  12555.  
  12556.   ColorPlay;
  12557.   { PalettePlay only intended to work on these drivers: }
  12558.   if (GraphDriver = EGA) or
  12559.       (GraphDriver = EGA64) or
  12560.       (GraphDriver = VGA) then
  12561.      PalettePlay;
  12562.   PutPixelPlay;
  12563. {  PutImagePlay; }
  12564.   RandBarPlay;
  12565.   BarPlay;
  12566.   Bar3DPlay;
  12567.   ArcPlay;
  12568.   CirclePlay;
  12569.   PiePlay;
  12570.   LineToPlay;
  12571.   LineRelPlay;
  12572. {  LineStylePlay; }
  12573. {  UserLineStylePlay; }
  12574.   TextDump;
  12575.   TextPlay;
  12576.   CrtModePlay;
  12577.   FillStylePlay;
  12578.   FillPatternPlay;
  12579.   PolyPlay;
  12580.   SayGoodbye;
  12581. {  CloseGraph; }
  12582.   CloseVesa;
  12583. end.
  12584. ***************************************************
  12585.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  12586.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  12587. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  12588. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  12589.     Color := RandColor;
  12590.     SetColor(Color);
  12591.     SetFillStyle(Random(CloseDotFill)+1, Color);
  12592.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  12593.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  12594.   until KeyPressed;
  12595.   WaitToGo;
  12596. end; { RandBarPlay }
  12597.  
  12598. procedure ArcPlay;
  12599. { Draw random arcs on the screen }
  12600. var
  12601.   MaxRadius : word;
  12602.   EndAngle : word;
  12603.   ArcInfo : ArcCoordsType;
  12604. begin
  12605.   MainWindow('Arc / GetArcCoords demonstration');
  12606.   StatusLine('Esc aborts or press a key');
  12607.   MaxRadius := MaxY div 10;
  12608.   repeat
  12609.     SetColor(RandColor);
  12610.     EndAngle := Random(360);
  12611.     SetLineStyle(SolidLn, 0, NormWidth);
  12612.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  12613.     GetArcCoords(ArcInfo);
  12614.     with ArcInfo do
  12615.     begin
  12616.       Line(X, Y, XStart, YStart);
  12617.       Line(X, Y, Xend, Yend);
  12618.     end;
  12619.   until KeyPressed;
  12620.   WaitToGo;
  12621. end; { ArcPlay }
  12622.  
  12623. procedure PutPixelPlay;
  12624. { Demonstrate the PutPixel and GetPixel commands }
  12625. const
  12626.   Seed   = 1962; { A seed for the random number generator }
  12627.   NumPts = 2000; { The number of pixels plotted }
  12628.   Esc    = #27;
  12629. var
  12630.   I : word;
  12631.   X, Y, Color : word;
  12632.   XMax, YMax  : integer;
  12633.   ViewInfo    : ViewPortType;
  12634. begin
  12635.   MainWindow('PutPixel / GetPixel demonstration');
  12636.   StatusLine('Esc aborts or press a key...');
  12637.  
  12638.   GetViewSettings(ViewInfo);
  12639.   with ViewInfo do
  12640.   begin
  12641.     XMax := (x2-x1-1);
  12642.     YMax := (y2-y1-1);
  12643.   end;
  12644.  
  12645.   while not KeyPressed do
  12646.   begin
  12647.     { Plot random pixels }
  12648.     RandSeed := Seed;
  12649.     I := 0;
  12650.     while (not KeyPressed) and (I < NumPts) do
  12651.     begin
  12652.       Inc(I);
  12653.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  12654.     end;
  12655.  
  12656.     { Erase pixels }
  12657.     RandSeed := Seed;
  12658.     I := 0;
  12659.     while (not KeyPressed) and (I < NumPts) do
  12660.     begin
  12661.       Inc(I);
  12662.       X := Random(XMax)+1;
  12663.       Y := Random(YMax)+1;
  12664.       Color := GetPixel(X, Y);
  12665.         if Color = RandColor then
  12666.           PutPixel(X, Y, 0);
  12667.      end;
  12668.   end;
  12669.   WaitToGo;
  12670. end; { PutPixelPlay }
  12671.  
  12672. procedure PutImagePlay;
  12673. { Demonstrate the GetImage and PutImage commands }
  12674.  
  12675. const
  12676.   r  = 20;
  12677.   StartX = 100;
  12678.   StartY = 50;
  12679.  
  12680. var
  12681.   CurPort : ViewPortType;
  12682.  
  12683. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  12684. var
  12685.   Step : integer;
  12686. begin
  12687.   Step := Random(2*r);
  12688.   if Odd(Step) then
  12689.     Step := -Step;
  12690.   X := X + Step;
  12691.   Step := Random(r);
  12692.   if Odd(Step) then
  12693.     Step := -Step;
  12694.   Y := Y + Step;
  12695.  
  12696.   { Make saucer bounce off viewport walls }
  12697.   with CurPort do
  12698.   begin
  12699.     if (x1 + X + Width - 1 > x2) then
  12700.       X := x2-x1 - Width + 1
  12701.     else
  12702.       if (X < 0) then
  12703.         X := 0;
  12704.     if (y1 + Y + Height - 1 > y2) then
  12705.       Y := y2-y1 - Height + 1
  12706.     else
  12707.       if (Y < 0) then
  12708.         Y := 0;
  12709.   end;
  12710. end; { MoveSaucer }
  12711.  
  12712. var
  12713.   Pausetime : word;
  12714.   Saucer    : pointer;
  12715.   X, Y      : integer;
  12716.   ulx, uly  : word;
  12717.   lrx, lry  : word;
  12718.   Size      : word;
  12719.   I         : word;
  12720. begin
  12721.   ClearDevice;
  12722.   FullPort;
  12723.  
  12724.   { PaintScreen }
  12725.   ClearDevice;
  12726.   MainWindow('GetImage / PutImage Demonstration');
  12727.   StatusLine('Esc aborts or press a key...');
  12728.   GetViewSettings(CurPort);
  12729.  
  12730.   { DrawSaucer }
  12731.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  12732.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  12733.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  12734.   Circle(StartX+10, StartY-12, 2);
  12735.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  12736.   Circle(StartX-10, StartY-12, 2);
  12737.   SetFillStyle(SolidFill, MaxColor);
  12738.   FloodFill(StartX+1, StartY+4, GetColor);
  12739.  
  12740.   { ReadSaucerImage }
  12741.   ulx := StartX-(r+1);
  12742.   uly := StartY-14;
  12743.   lrx := StartX+(r+1);
  12744.   lry := StartY+(r div 3)+3;
  12745.  
  12746.   Size := ImageSize(ulx, uly, lrx, lry);
  12747.   GetMem(Saucer, Size);
  12748.   GetImage(ulx, uly, lrx, lry, Saucer^);
  12749. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  12750.  
  12751.   { Plot some "stars" }
  12752.   for I := 1 to 1000 do
  12753.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  12754.   X := MaxX div 2;
  12755.   Y := MaxY div 2;
  12756.   PauseTime := 70;
  12757.  
  12758.   { Move the saucer around }
  12759.   repeat
  12760. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  12761.      Delay(PauseTime);
  12762. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  12763.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  12764.   until KeyPressed;
  12765.   FreeMem(Saucer, size);
  12766.   WaitToGo;
  12767. end; { PutImagePlay }
  12768.  
  12769. procedure PolyPlay;
  12770. { Draw random polygons with random fill styles on the screen }
  12771. const
  12772.   MaxPts = 5;
  12773. type
  12774.   PolygonType = array[1..MaxPts] of PointType;
  12775. var
  12776.   Poly : PolygonType;
  12777.   I, Color : word;
  12778. begin
  12779.   MainWindow('FillPoly demonstration');
  12780.   StatusLine('Esc aborts or press a key...');
  12781.   repeat
  12782.     Color := RandColor;
  12783.     SetFillStyle(Random(11)+1, Color);
  12784.     SetColor(Color);
  12785.     for I := 1 to MaxPts do
  12786.       with Poly[I] do
  12787.       begin
  12788.         X := Random(MaxX);
  12789.         Y := Random(MaxY);
  12790.       end;
  12791.     FillPoly(MaxPts, Poly);
  12792.   until KeyPressed;
  12793.   WaitToGo;
  12794. end; { PolyPlay }
  12795.  
  12796. procedure FillStylePlay;
  12797. { Display all of the predefined fill styles available }
  12798. var
  12799.   Style    : word;
  12800.   Width    : word;
  12801.   Height   : word;
  12802.   X, Y     : word;
  12803.   I, J     : word;
  12804.   ViewInfo : ViewPortType;
  12805.  
  12806. procedure DrawBox(X, Y : word);
  12807. begin
  12808.   SetFillStyle(Style, MaxColor);
  12809.   with ViewInfo do
  12810.     Bar(X, Y, X+Width, Y+Height);
  12811.   Rectangle(X, Y, X+Width, Y+Height);
  12812.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  12813.   Inc(Style);
  12814. end; { DrawBox }
  12815.  
  12816. begin
  12817.   MainWindow('Pre-defined fill styles');
  12818.   GetViewSettings(ViewInfo);
  12819.   with ViewInfo do
  12820.   begin
  12821.     Width := 2 * ((x2+1) div 13);
  12822.     Height := 2 * ((y2-10) div 10);
  12823.   end;
  12824.   X := Width div 2;
  12825.   Y := Height div 2;
  12826.   Style := 0;
  12827.   for J := 1 to 3 do
  12828.   begin
  12829.     for I := 1 to 4 do
  12830.     begin
  12831.       DrawBox(X, Y);
  12832.       Inc(X, (Width div 2) * 3);
  12833.     end;
  12834.     X := Width div 2;
  12835.     Inc(Y, (Height div 2) * 3);
  12836.   end;
  12837.   SetTextJustify(LeftText, TopText);
  12838.   WaitToGo;
  12839. end; { FillStylePlay }
  12840.  
  12841. procedure FillPatternPlay;
  12842. { Display some user defined fill patterns }
  12843. const
  12844.   Patterns : array[0..11] of FillPatternType = (
  12845.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  12846.             OldColor which has a path of pixels of OldColor or NewColor
  12847.             with sides touching back to the seed point, (XSeed, YSeed).
  12848.             Therefore, only pixels of OldColor are modified and no other
  12849.             information is changed.
  12850.  
  12851.             SEE ALSO
  12852.  
  12853.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  12854.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  12855.             SETVIEW
  12856.  
  12857.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  12858.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  12859.             IF WHICHVGA = 0 THEN STOP
  12860.             DUMMY=RES640
  12861.             SETVIEW 100, 100, 539, 379
  12862.             FILLVIEW 10
  12863.             WHILE INKEY$ = ""
  12864.             WEND
  12865.             VIDEOMODESET VMODE
  12866.             END
  12867.  
  12868.  
  12869.  
  12870.  
  12871.  
  12872.  
  12873.  
  12874.  
  12875.  
  12876.  
  12877.  
  12878.  
  12879.  
  12880.  
  12881.  
  12882.  
  12883.                                                                          63
  12884.  
  12885.  
  12886.  
  12887.  
  12888.  
  12889.           FONTGETINFO
  12890.  
  12891.             PROTOTYPE
  12892.  
  12893.             SUB FONTGETINFO (Width%, Height%)
  12894.  
  12895.             INPUT
  12896.  
  12897.             no input parameters
  12898.     WEND
  12899.             MOUSEEXIT
  12900.             VIDEOMODESET VMODE
  12901.             END
  12902.  
  12903.  
  12904.  
  12905.  
  12906.  
  12907.  
  12908.  
  12909.  
  12910.  
  12911.  
  12912.  
  12913.  
  12914.  
  12915.  
  12916.  
  12917.  
  12918.  
  12919.  
  12920.  
  12921.  
  12922.  
  12923.  
  12924.  
  12925.  
  12926.  
  12927.  
  12928.  
  12929.  
  12930.  
  12931.  
  12932.  
  12933.  
  12934.  
  12935.  
  12936.  
  12937.  
  12938.  
  12939.  
  12940.  
  12941.  
  12942.                                                                          86
  12943.  
  12944.  
  12945.  
  12946.  
  12947.  
  12948.           MOUSECURSORDEFAULT
  12949.  
  12950.             PROTOTYPE
  12951.  
  12952.             SUB MOUSECURSORDEFAULT ()
  12953.  
  12954.             INPUT
  12955.  
  12956.             no input parameters
  12957.  
  12958.             OUTPUT
  12959.  
  12960.             no value returned
  12961.  
  12962.             USAGE
  12963.  
  12964.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  12965.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  12966. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  12967. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  12968. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  12969. $╤
  12970. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  12971. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  12972. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  12973.       end;
  12974.     end;
  12975.   end;
  12976.   WaitToGo;
  12977. end; { UserLineStylePlay }
  12978.  
  12979.  
  12980. procedure SayGoodbye;
  12981. { Say goodbye and then exit the program }
  12982. var
  12983.   ViewInfo : ViewPortType;
  12984. begin
  12985.   MainWindow('');
  12986.   GetViewSettings(ViewInfo);
  12987.   SetTextStyle(TriplexFont, HorizDir, 4);
  12988.   SetTextJustify(CenterText, CenterText);
  12989.   with ViewInfo do
  12990.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  12991.   StatusLine('Press any key to quit...');
  12992.   repeat until KeyPressed;
  12993. end; { SayGoodbye }
  12994.  
  12995.  
  12996. PROCEDURE SelectMode;
  12997. VAR
  12998.     choice1,choice2     : CHAR;
  12999.    xsize,ysize            : WORD;
  13000. BEGIN
  13001.     (* Let's select a mode *)
  13002.     ClrScr;
  13003.     WriteLn('VESADEMO:');
  13004.     WriteLn('1. 256 colors');
  13005.     WriteLn('2. 32768 colors');
  13006.     WriteLn('3. 65536 colors');
  13007.     WriteLn('4. 16777216 colors');
  13008.     WriteLn('Q uit');
  13009.     WriteLn;
  13010.     Write('Your choice: ');
  13011.     REPEAT
  13012.         ReadLn(choice1);
  13013.       IF choice1 <> '1' THEN BEGIN
  13014.           WriteLn('Sorry !');
  13015.          WriteLn('This demo wasn''t written for more as 256 colors !');
  13016.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  13017.          WriteLn('Switching to 256 colors.');
  13018.          choice1 := '1';
  13019.       END;
  13020.     UNTIL choice1 IN ['1'..'4','q'];
  13021.     IF choice1 = 'q' THEN Halt;
  13022.  
  13023.     WriteLn;
  13024.     WriteLn;
  13025.     WriteLn('a. 320x200');
  13026.     WriteLn('b. 640x480');
  13027.     WriteLn('c. 800x600');
  13028.     WriteLn('d. 1024x768');
  13029.     WriteLn('e. 1280x1024');
  13030.     WriteLn('Q uit');
  13031.     WriteLn;
  13032.     Write('Your choice: ');
  13033.     REPEAT
  13034.         ReadLn(choice2);
  13035.     UNTIL choice2 IN ['a'..'e','q'];
  13036.     IF choice2 = 'q' THEN Halt;
  13037.  
  13038.     CASE choice2 OF
  13039.         'a' : BEGIN
  13040.             xsize := 320;
  13041.             ysize := 200;
  13042.         END;
  13043.         'b' : BEGIN
  13044.             xsize := 640;
  13045.             ysize := 480;
  13046.         END;
  13047.         'c' : BEGIN
  13048.             xsize := 800;
  13049.             ysize := 600;
  13050.         END;
  13051.         'd' : BEGIN
  13052.             xsize := 1024;
  13053.             ysize := 768;
  13054.         END;
  13055.         'e' : BEGIN
  13056.             xsize := 1280;
  13057.             ysize := 1024;
  13058.         END;
  13059.     END;
  13060.     CASE choice1 OF
  13061.         '1' : mode := FindVesaMode(xsize,ysize,8);
  13062.         '2' : mode := FindVesaMode(xsize,ysize,15);
  13063.         '3' : mode := FindVesaMode(xsize,ysize,16);
  13064.         '4' : mode := FindVesaMode(xsize,ysize,24);
  13065.     END;
  13066.     IF mode = 0 THEN BEGIN
  13067.         WriteLn('No such mode could be found !');
  13068.         WriteLn('Switching to to 320x200.');
  13069.         ReadKey;
  13070.         mode := V320x200x256;
  13071.     END;
  13072. END;
  13073.  
  13074. begin { program body }
  13075.   SelectMode;
  13076.   Initialize;
  13077.   ReportStatus;
  13078.  
  13079. {  AspectRatioPlay; }
  13080.   FillEllipsePlay;
  13081.   SectorPlay;
  13082.   WriteModePlay;
  13083.  
  13084.   ColorPlay;
  13085.   { PalettePlay only intended to work on these drivers: }
  13086.   if (GraphDriver = EGA) or
  13087.       (GraphDriver = EGA64) or
  13088.       (GraphDriver = VGA) then
  13089.      PalettePlay;
  13090.   PutPixelPlay;
  13091. {  PutImagePlay; }
  13092.   RandBarPlay;
  13093.   BarPlay;
  13094.   Bar3DPlay;
  13095.   ArcPlay;
  13096.   CirclePlay;
  13097.   PiePlay;
  13098.   LineToPlay;
  13099.   LineRelPlay;
  13100. {  LineStylePlay; }
  13101. {  UserLineStylePlay; }
  13102.   TextDump;
  13103.   TextPlay;
  13104.   CrtModePlay;
  13105.   FillStylePlay;
  13106.   FillPatternPlay;
  13107.   PolyPlay;
  13108.   SayGoodbye;
  13109. {  CloseGraph; }
  13110.   CloseVesa;
  13111. end.
  13112. ***************************************************
  13113.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  13114.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  13115. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  13116. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  13117.     Color := RandColor;
  13118.     SetColor(Color);
  13119.     SetFillStyle(Random(CloseDotFill)+1, Color);
  13120.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  13121.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  13122.   until KeyPressed;
  13123.   WaitToGo;
  13124. end; { RandBarPlay }
  13125.  
  13126. procedure ArcPlay;
  13127. { Draw random arcs on the screen }
  13128. var
  13129.   MaxRadius : word;
  13130.   EndAngle : word;
  13131.   ArcInfo : ArcCoordsType;
  13132. begin
  13133.   MainWindow('Arc / GetArcCoords demonstration');
  13134.   StatusLine('Esc aborts or press a key');
  13135.   MaxRadius := MaxY div 10;
  13136.   repeat
  13137.     SetColor(RandColor);
  13138.     EndAngle := Random(360);
  13139.     SetLineStyle(SolidLn, 0, NormWidth);
  13140.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  13141.     GetArcCoords(ArcInfo);
  13142.     with ArcInfo do
  13143.     begin
  13144.       Line(X, Y, XStart, YStart);
  13145.       Line(X, Y, Xend, Yend);
  13146.     end;
  13147.   until KeyPressed;
  13148.   WaitToGo;
  13149. end; { ArcPlay }
  13150.  
  13151. procedure PutPixelPlay;
  13152. { Demonstrate the PutPixel and GetPixel commands }
  13153. const
  13154.   Seed   = 1962; { A seed for the random number generator }
  13155.   NumPts = 2000; { The number of pixels plotted }
  13156.   Esc    = #27;
  13157. var
  13158.   I : word;
  13159.   X, Y, Color : word;
  13160.   XMax, YMax  : integer;
  13161.   ViewInfo    : ViewPortType;
  13162. begin
  13163.   MainWindow('PutPixel / GetPixel demonstration');
  13164.   StatusLine('Esc aborts or press a key...');
  13165.  
  13166.   GetViewSettings(ViewInfo);
  13167.   with ViewInfo do
  13168.   begin
  13169.     XMax := (x2-x1-1);
  13170.     YMax := (y2-y1-1);
  13171.   end;
  13172.  
  13173.   while not KeyPressed do
  13174.   begin
  13175.     { Plot random pixels }
  13176.     RandSeed := Seed;
  13177.     I := 0;
  13178.     while (not KeyPressed) and (I < NumPts) do
  13179.     begin
  13180.       Inc(I);
  13181.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  13182.     end;
  13183.  
  13184.     { Erase pixels }
  13185.     RandSeed := Seed;
  13186.     I := 0;
  13187.     while (not KeyPressed) and (I < NumPts) do
  13188.     begin
  13189.       Inc(I);
  13190.       X := Random(XMax)+1;
  13191.       Y := Random(YMax)+1;
  13192.       Color := GetPixel(X, Y);
  13193.         if Color = RandColor then
  13194.           PutPixel(X, Y, 0);
  13195.      end;
  13196.   end;
  13197.   WaitToGo;
  13198. end; { PutPixelPlay }
  13199.  
  13200. procedure PutImagePlay;
  13201. { Demonstrate the GetImage and PutImage commands }
  13202.  
  13203. const
  13204.   r  = 20;
  13205.   StartX = 100;
  13206.   StartY = 50;
  13207.  
  13208. var
  13209.   CurPort : ViewPortType;
  13210.  
  13211. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  13212. var
  13213.   Step : integer;
  13214. begin
  13215.   Step := Random(2*r);
  13216.   if Odd(Step) then
  13217.     Step := -Step;
  13218.   X := X + Step;
  13219.   Step := Random(r);
  13220.   if Odd(Step) then
  13221.     Step := -Step;
  13222.   Y := Y + Step;
  13223.  
  13224.   { Make saucer bounce off viewport walls }
  13225.   with CurPort do
  13226.   begin
  13227.     if (x1 + X + Width - 1 > x2) then
  13228.       X := x2-x1 - Width + 1
  13229.     else
  13230.       if (X < 0) then
  13231.         X := 0;
  13232.     if (y1 + Y + Height - 1 > y2) then
  13233.       Y := y2-y1 - Height + 1
  13234.     else
  13235.       if (Y < 0) then
  13236.         Y := 0;
  13237.   end;
  13238. end; { MoveSaucer }
  13239.  
  13240. var
  13241.   Pausetime : word;
  13242.   Saucer    : pointer;
  13243.   X, Y      : integer;
  13244.   ulx, uly  : word;
  13245.   lrx, lry  : word;
  13246.   Size      : word;
  13247.   I         : word;
  13248. begin
  13249.   ClearDevice;
  13250.   FullPort;
  13251.  
  13252.   { PaintScreen }
  13253.   ClearDevice;
  13254.   MainWindow('GetImage / PutImage Demonstration');
  13255.   StatusLine('Esc aborts or press a key...');
  13256.   GetViewSettings(CurPort);
  13257.  
  13258.   { DrawSaucer }
  13259.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  13260.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  13261.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  13262.   Circle(StartX+10, StartY-12, 2);
  13263.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  13264.   Circle(StartX-10, StartY-12, 2);
  13265.   SetFillStyle(SolidFill, MaxColor);
  13266.   FloodFill(StartX+1, StartY+4, GetColor);
  13267.  
  13268.   { ReadSaucerImage }
  13269.   ulx := StartX-(r+1);
  13270.   uly := StartY-14;
  13271.   lrx := StartX+(r+1);
  13272.   lry := StartY+(r div 3)+3;
  13273.  
  13274.   Size := ImageSize(ulx, uly, lrx, lry);
  13275.   GetMem(Saucer, Size);
  13276.   GetImage(ulx, uly, lrx, lry, Saucer^);
  13277. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  13278.  
  13279.   { Plot some "stars" }
  13280.   for I := 1 to 1000 do
  13281.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  13282.   X := MaxX div 2;
  13283.   Y := MaxY div 2;
  13284.   PauseTime := 70;
  13285.  
  13286.   { Move the saucer around }
  13287.   repeat
  13288. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  13289.      Delay(PauseTime);
  13290. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  13291.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  13292.   until KeyPressed;
  13293.   FreeMem(Saucer, size);
  13294.   WaitToGo;
  13295. end; { PutImagePlay }
  13296.  
  13297. procedure PolyPlay;
  13298. { Draw random polygons with random fill styles on the screen }
  13299. const
  13300.   MaxPts = 5;
  13301. type
  13302.   PolygonType = array[1..MaxPts] of PointType;
  13303. var
  13304.   Poly : PolygonType;
  13305.   I, Color : word;
  13306. begin
  13307.   MainWindow('FillPoly demonstration');
  13308.   StatusLine('Esc aborts or press a key...');
  13309.   repeat
  13310.     Color := RandColor;
  13311.     SetFillStyle(Random(11)+1, Color);
  13312.     SetColor(Color);
  13313.     for I := 1 to MaxPts do
  13314.       with Poly[I] do
  13315.       begin
  13316.         X := Random(MaxX);
  13317.         Y := Random(MaxY);
  13318.       end;
  13319.     FillPoly(MaxPts, Poly);
  13320.   until KeyPressed;
  13321.   WaitToGo;
  13322. end; { PolyPlay }
  13323.  
  13324. procedure FillStylePlay;
  13325. { Display all of the predefined fill styles available }
  13326. var
  13327.   Style    : word;
  13328.   Width    : word;
  13329.   Height   : word;
  13330.   X, Y     : word;
  13331.   I, J     : word;
  13332.   ViewInfo : ViewPortType;
  13333.  
  13334. procedure DrawBox(X, Y : word);
  13335. begin
  13336.   SetFillStyle(Style, MaxColor);
  13337.   with ViewInfo do
  13338.     Bar(X, Y, X+Width, Y+Height);
  13339.   Rectangle(X, Y, X+Width, Y+Height);
  13340.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  13341.   Inc(Style);
  13342. end; { DrawBox }
  13343.  
  13344. begin
  13345.   MainWindow('Pre-defined fill styles');
  13346.   GetViewSettings(ViewInfo);
  13347.   with ViewInfo do
  13348.   begin
  13349.     Width := 2 * ((x2+1) div 13);
  13350.     Height := 2 * ((y2-10) div 10);
  13351.   end;
  13352.   X := Width div 2;
  13353.   Y := Height div 2;
  13354.   Style := 0;
  13355.   for J := 1 to 3 do
  13356.   begin
  13357.     for I := 1 to 4 do
  13358.     begin
  13359.       DrawBox(X, Y);
  13360.       Inc(X, (Width div 2) * 3);
  13361.     end;
  13362.     X := Width div 2;
  13363.     Inc(Y, (Height div 2) * 3);
  13364.   end;
  13365.   SetTextJustify(LeftText, TopText);
  13366.   WaitToGo;
  13367. end; { FillStylePlay }
  13368.  
  13369. procedure FillPatternPlay;
  13370. { Display some user defined fill patterns }
  13371. const
  13372.   Patterns : array[0..11] of FillPatternType = (
  13373.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  13374.             OldColor which has a path of pixels of OldColor or NewColor
  13375.             with sides touching back to the seed point, (XSeed, YSeed).
  13376.             Therefore, only pixels of OldColor are modified and no other
  13377.             information is changed.
  13378.  
  13379.             SEE ALSO
  13380.  
  13381.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  13382.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  13383.             SETVIEW
  13384.  
  13385.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  13386.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  13387.             IF WHICHVGA = 0 THEN STOP
  13388.             DUMMY=RES640
  13389.             SETVIEW 100, 100, 539, 379
  13390.             FILLVIEW 10
  13391.             WHILE INKEY$ = ""
  13392.             WEND
  13393.             VIDEOMODESET VMODE
  13394.             END
  13395.  
  13396.  
  13397.  
  13398.  
  13399.  
  13400.  
  13401.  
  13402.  
  13403.  
  13404.  
  13405.  
  13406.  
  13407.  
  13408.  
  13409.  
  13410.  
  13411.                                                                          63
  13412.  
  13413.  
  13414.  
  13415.  
  13416.  
  13417.           FONTGETINFO
  13418.  
  13419.             PROTOTYPE
  13420.  
  13421.             SUB FONTGETINFO (Width%, Height%)
  13422.  
  13423.             INPUT
  13424.  
  13425.             no input parameters
  13426.     WEND
  13427.             MOUSEEXIT
  13428.             VIDEOMODESET VMODE
  13429.             END
  13430.  
  13431.  
  13432.  
  13433.  
  13434.  
  13435.  
  13436.  
  13437.  
  13438.  
  13439.  
  13440.  
  13441.  
  13442.  
  13443.  
  13444.  
  13445.  
  13446.  
  13447.  
  13448.  
  13449.  
  13450.  
  13451.  
  13452.  
  13453.  
  13454.  
  13455.  
  13456.  
  13457.  
  13458.  
  13459.  
  13460.  
  13461.  
  13462.  
  13463.  
  13464.  
  13465.  
  13466.  
  13467.  
  13468.  
  13469.  
  13470.                                                                          86
  13471.  
  13472.  
  13473.  
  13474.  
  13475.  
  13476.           MOUSECURSORDEFAULT
  13477.  
  13478.             PROTOTYPE
  13479.  
  13480.             SUB MOUSECURSORDEFAULT ()
  13481.  
  13482.             INPUT
  13483.  
  13484.             no input parameters
  13485.  
  13486.             OUTPUT
  13487.  
  13488.             no value returned
  13489.  
  13490.             USAGE
  13491.  
  13492.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  13493.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  13494. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  13495. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  13496. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  13497. $╤
  13498. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  13499. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  13500. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  13501.       end;
  13502.     end;
  13503.   end;
  13504.   WaitToGo;
  13505. end; { UserLineStylePlay }
  13506.  
  13507.  
  13508. procedure SayGoodbye;
  13509. { Say goodbye and then exit the program }
  13510. var
  13511.   ViewInfo : ViewPortType;
  13512. begin
  13513.   MainWindow('');
  13514.   GetViewSettings(ViewInfo);
  13515.   SetTextStyle(TriplexFont, HorizDir, 4);
  13516.   SetTextJustify(CenterText, CenterText);
  13517.   with ViewInfo do
  13518.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  13519.   StatusLine('Press any key to quit...');
  13520.   repeat until KeyPressed;
  13521. end; { SayGoodbye }
  13522.  
  13523.  
  13524. PROCEDURE SelectMode;
  13525. VAR
  13526.     choice1,choice2     : CHAR;
  13527.    xsize,ysize            : WORD;
  13528. BEGIN
  13529.     (* Let's select a mode *)
  13530.     ClrScr;
  13531.     WriteLn('VESADEMO:');
  13532.     WriteLn('1. 256 colors');
  13533.     WriteLn('2. 32768 colors');
  13534.     WriteLn('3. 65536 colors');
  13535.     WriteLn('4. 16777216 colors');
  13536.     WriteLn('Q uit');
  13537.     WriteLn;
  13538.     Write('Your choice: ');
  13539.     REPEAT
  13540.         ReadLn(choice1);
  13541.       IF choice1 <> '1' THEN BEGIN
  13542.           WriteLn('Sorry !');
  13543.          WriteLn('This demo wasn''t written for more as 256 colors !');
  13544.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  13545.          WriteLn('Switching to 256 colors.');
  13546.          choice1 := '1';
  13547.       END;
  13548.     UNTIL choice1 IN ['1'..'4','q'];
  13549.     IF choice1 = 'q' THEN Halt;
  13550.  
  13551.     WriteLn;
  13552.     WriteLn;
  13553.     WriteLn('a. 320x200');
  13554.     WriteLn('b. 640x480');
  13555.     WriteLn('c. 800x600');
  13556.     WriteLn('d. 1024x768');
  13557.     WriteLn('e. 1280x1024');
  13558.     WriteLn('Q uit');
  13559.     WriteLn;
  13560.     Write('Your choice: ');
  13561.     REPEAT
  13562.         ReadLn(choice2);
  13563.     UNTIL choice2 IN ['a'..'e','q'];
  13564.     IF choice2 = 'q' THEN Halt;
  13565.  
  13566.     CASE choice2 OF
  13567.         'a' : BEGIN
  13568.             xsize := 320;
  13569.             ysize := 200;
  13570.         END;
  13571.         'b' : BEGIN
  13572.             xsize := 640;
  13573.             ysize := 480;
  13574.         END;
  13575.         'c' : BEGIN
  13576.             xsize := 800;
  13577.             ysize := 600;
  13578.         END;
  13579.         'd' : BEGIN
  13580.             xsize := 1024;
  13581.             ysize := 768;
  13582.         END;
  13583.         'e' : BEGIN
  13584.             xsize := 1280;
  13585.             ysize := 1024;
  13586.         END;
  13587.     END;
  13588.     CASE choice1 OF
  13589.         '1' : mode := FindVesaMode(xsize,ysize,8);
  13590.         '2' : mode := FindVesaMode(xsize,ysize,15);
  13591.         '3' : mode := FindVesaMode(xsize,ysize,16);
  13592.         '4' : mode := FindVesaMode(xsize,ysize,24);
  13593.     END;
  13594.     IF mode = 0 THEN BEGIN
  13595.         WriteLn('No such mode could be found !');
  13596.         WriteLn('Switching to to 320x200.');
  13597.         ReadKey;
  13598.         mode := V320x200x256;
  13599.     END;
  13600. END;
  13601.  
  13602. begin { program body }
  13603.   SelectMode;
  13604.   Initialize;
  13605.   ReportStatus;
  13606.  
  13607. {  AspectRatioPlay; }
  13608.   FillEllipsePlay;
  13609.   SectorPlay;
  13610.   WriteModePlay;
  13611.  
  13612.   ColorPlay;
  13613.   { PalettePlay only intended to work on these drivers: }
  13614.   if (GraphDriver = EGA) or
  13615.       (GraphDriver = EGA64) or
  13616.       (GraphDriver = VGA) then
  13617.      PalettePlay;
  13618.   PutPixelPlay;
  13619. {  PutImagePlay; }
  13620.   RandBarPlay;
  13621.   BarPlay;
  13622.   Bar3DPlay;
  13623.   ArcPlay;
  13624.   CirclePlay;
  13625.   PiePlay;
  13626.   LineToPlay;
  13627.   LineRelPlay;
  13628. {  LineStylePlay; }
  13629. {  UserLineStylePlay; }
  13630.   TextDump;
  13631.   TextPlay;
  13632.   CrtModePlay;
  13633.   FillStylePlay;
  13634.   FillPatternPlay;
  13635.   PolyPlay;
  13636.   SayGoodbye;
  13637. {  CloseGraph; }
  13638.   CloseVesa;
  13639. end.
  13640. ***************************************************
  13641.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  13642.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  13643. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  13644. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  13645.     Color := RandColor;
  13646.     SetColor(Color);
  13647.     SetFillStyle(Random(CloseDotFill)+1, Color);
  13648.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  13649.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  13650.   until KeyPressed;
  13651.   WaitToGo;
  13652. end; { RandBarPlay }
  13653.  
  13654. procedure ArcPlay;
  13655. { Draw random arcs on the screen }
  13656. var
  13657.   MaxRadius : word;
  13658.   EndAngle : word;
  13659.   ArcInfo : ArcCoordsType;
  13660. begin
  13661.   MainWindow('Arc / GetArcCoords demonstration');
  13662.   StatusLine('Esc aborts or press a key');
  13663.   MaxRadius := MaxY div 10;
  13664.   repeat
  13665.     SetColor(RandColor);
  13666.     EndAngle := Random(360);
  13667.     SetLineStyle(SolidLn, 0, NormWidth);
  13668.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  13669.     GetArcCoords(ArcInfo);
  13670.     with ArcInfo do
  13671.     begin
  13672.       Line(X, Y, XStart, YStart);
  13673.       Line(X, Y, Xend, Yend);
  13674.     end;
  13675.   until KeyPressed;
  13676.   WaitToGo;
  13677. end; { ArcPlay }
  13678.  
  13679. procedure PutPixelPlay;
  13680. { Demonstrate the PutPixel and GetPixel commands }
  13681. const
  13682.   Seed   = 1962; { A seed for the random number generator }
  13683.   NumPts = 2000; { The number of pixels plotted }
  13684.   Esc    = #27;
  13685. var
  13686.   I : word;
  13687.   X, Y, Color : word;
  13688.   XMax, YMax  : integer;
  13689.   ViewInfo    : ViewPortType;
  13690. begin
  13691.   MainWindow('PutPixel / GetPixel demonstration');
  13692.   StatusLine('Esc aborts or press a key...');
  13693.  
  13694.   GetViewSettings(ViewInfo);
  13695.   with ViewInfo do
  13696.   begin
  13697.     XMax := (x2-x1-1);
  13698.     YMax := (y2-y1-1);
  13699.   end;
  13700.  
  13701.   while not KeyPressed do
  13702.   begin
  13703.     { Plot random pixels }
  13704.     RandSeed := Seed;
  13705.     I := 0;
  13706.     while (not KeyPressed) and (I < NumPts) do
  13707.     begin
  13708.       Inc(I);
  13709.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  13710.     end;
  13711.  
  13712.     { Erase pixels }
  13713.     RandSeed := Seed;
  13714.     I := 0;
  13715.     while (not KeyPressed) and (I < NumPts) do
  13716.     begin
  13717.       Inc(I);
  13718.       X := Random(XMax)+1;
  13719.       Y := Random(YMax)+1;
  13720.       Color := GetPixel(X, Y);
  13721.         if Color = RandColor then
  13722.           PutPixel(X, Y, 0);
  13723.      end;
  13724.   end;
  13725.   WaitToGo;
  13726. end; { PutPixelPlay }
  13727.  
  13728. procedure PutImagePlay;
  13729. { Demonstrate the GetImage and PutImage commands }
  13730.  
  13731. const
  13732.   r  = 20;
  13733.   StartX = 100;
  13734.   StartY = 50;
  13735.  
  13736. var
  13737.   CurPort : ViewPortType;
  13738.  
  13739. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  13740. var
  13741.   Step : integer;
  13742. begin
  13743.   Step := Random(2*r);
  13744.   if Odd(Step) then
  13745.     Step := -Step;
  13746.   X := X + Step;
  13747.   Step := Random(r);
  13748.   if Odd(Step) then
  13749.     Step := -Step;
  13750.   Y := Y + Step;
  13751.  
  13752.   { Make saucer bounce off viewport walls }
  13753.   with CurPort do
  13754.   begin
  13755.     if (x1 + X + Width - 1 > x2) then
  13756.       X := x2-x1 - Width + 1
  13757.     else
  13758.       if (X < 0) then
  13759.         X := 0;
  13760.     if (y1 + Y + Height - 1 > y2) then
  13761.       Y := y2-y1 - Height + 1
  13762.     else
  13763.       if (Y < 0) then
  13764.         Y := 0;
  13765.   end;
  13766. end; { MoveSaucer }
  13767.  
  13768. var
  13769.   Pausetime : word;
  13770.   Saucer    : pointer;
  13771.   X, Y      : integer;
  13772.   ulx, uly  : word;
  13773.   lrx, lry  : word;
  13774.   Size      : word;
  13775.   I         : word;
  13776. begin
  13777.   ClearDevice;
  13778.   FullPort;
  13779.  
  13780.   { PaintScreen }
  13781.   ClearDevice;
  13782.   MainWindow('GetImage / PutImage Demonstration');
  13783.   StatusLine('Esc aborts or press a key...');
  13784.   GetViewSettings(CurPort);
  13785.  
  13786.   { DrawSaucer }
  13787.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  13788.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  13789.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  13790.   Circle(StartX+10, StartY-12, 2);
  13791.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  13792.   Circle(StartX-10, StartY-12, 2);
  13793.   SetFillStyle(SolidFill, MaxColor);
  13794.   FloodFill(StartX+1, StartY+4, GetColor);
  13795.  
  13796.   { ReadSaucerImage }
  13797.   ulx := StartX-(r+1);
  13798.   uly := StartY-14;
  13799.   lrx := StartX+(r+1);
  13800.   lry := StartY+(r div 3)+3;
  13801.  
  13802.   Size := ImageSize(ulx, uly, lrx, lry);
  13803.   GetMem(Saucer, Size);
  13804.   GetImage(ulx, uly, lrx, lry, Saucer^);
  13805. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  13806.  
  13807.   { Plot some "stars" }
  13808.   for I := 1 to 1000 do
  13809.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  13810.   X := MaxX div 2;
  13811.   Y := MaxY div 2;
  13812.   PauseTime := 70;
  13813.  
  13814.   { Move the saucer around }
  13815.   repeat
  13816. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  13817.      Delay(PauseTime);
  13818. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  13819.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  13820.   until KeyPressed;
  13821.   FreeMem(Saucer, size);
  13822.   WaitToGo;
  13823. end; { PutImagePlay }
  13824.  
  13825. procedure PolyPlay;
  13826. { Draw random polygons with random fill styles on the screen }
  13827. const
  13828.   MaxPts = 5;
  13829. type
  13830.   PolygonType = array[1..MaxPts] of PointType;
  13831. var
  13832.   Poly : PolygonType;
  13833.   I, Color : word;
  13834. begin
  13835.   MainWindow('FillPoly demonstration');
  13836.   StatusLine('Esc aborts or press a key...');
  13837.   repeat
  13838.     Color := RandColor;
  13839.     SetFillStyle(Random(11)+1, Color);
  13840.     SetColor(Color);
  13841.     for I := 1 to MaxPts do
  13842.       with Poly[I] do
  13843.       begin
  13844.         X := Random(MaxX);
  13845.         Y := Random(MaxY);
  13846.       end;
  13847.     FillPoly(MaxPts, Poly);
  13848.   until KeyPressed;
  13849.   WaitToGo;
  13850. end; { PolyPlay }
  13851.  
  13852. procedure FillStylePlay;
  13853. { Display all of the predefined fill styles available }
  13854. var
  13855.   Style    : word;
  13856.   Width    : word;
  13857.   Height   : word;
  13858.   X, Y     : word;
  13859.   I, J     : word;
  13860.   ViewInfo : ViewPortType;
  13861.  
  13862. procedure DrawBox(X, Y : word);
  13863. begin
  13864.   SetFillStyle(Style, MaxColor);
  13865.   with ViewInfo do
  13866.     Bar(X, Y, X+Width, Y+Height);
  13867.   Rectangle(X, Y, X+Width, Y+Height);
  13868.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  13869.   Inc(Style);
  13870. end; { DrawBox }
  13871.  
  13872. begin
  13873.   MainWindow('Pre-defined fill styles');
  13874.   GetViewSettings(ViewInfo);
  13875.   with ViewInfo do
  13876.   begin
  13877.     Width := 2 * ((x2+1) div 13);
  13878.     Height := 2 * ((y2-10) div 10);
  13879.   end;
  13880.   X := Width div 2;
  13881.   Y := Height div 2;
  13882.   Style := 0;
  13883.   for J := 1 to 3 do
  13884.   begin
  13885.     for I := 1 to 4 do
  13886.     begin
  13887.       DrawBox(X, Y);
  13888.       Inc(X, (Width div 2) * 3);
  13889.     end;
  13890.     X := Width div 2;
  13891.     Inc(Y, (Height div 2) * 3);
  13892.   end;
  13893.   SetTextJustify(LeftText, TopText);
  13894.   WaitToGo;
  13895. end; { FillStylePlay }
  13896.  
  13897. procedure FillPatternPlay;
  13898. { Display some user defined fill patterns }
  13899. const
  13900.   Patterns : array[0..11] of FillPatternType = (
  13901.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  13902.             OldColor which has a path of pixels of OldColor or NewColor
  13903.             with sides touching back to the seed point, (XSeed, YSeed).
  13904.             Therefore, only pixels of OldColor are modified and no other
  13905.             information is changed.
  13906.  
  13907.             SEE ALSO
  13908.  
  13909.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  13910.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  13911.             SETVIEW
  13912.  
  13913.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  13914.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  13915.             IF WHICHVGA = 0 THEN STOP
  13916.             DUMMY=RES640
  13917.             SETVIEW 100, 100, 539, 379
  13918.             FILLVIEW 10
  13919.             WHILE INKEY$ = ""
  13920.             WEND
  13921.             VIDEOMODESET VMODE
  13922.             END
  13923.  
  13924.  
  13925.  
  13926.  
  13927.  
  13928.  
  13929.  
  13930.  
  13931.  
  13932.  
  13933.  
  13934.  
  13935.  
  13936.  
  13937.  
  13938.  
  13939.                                                                          63
  13940.  
  13941.  
  13942.  
  13943.  
  13944.  
  13945.           FONTGETINFO
  13946.  
  13947.             PROTOTYPE
  13948.  
  13949.             SUB FONTGETINFO (Width%, Height%)
  13950.  
  13951.             INPUT
  13952.  
  13953.             no input parameters
  13954.     WEND
  13955.             MOUSEEXIT
  13956.             VIDEOMODESET VMODE
  13957.             END
  13958.  
  13959.  
  13960.  
  13961.  
  13962.  
  13963.  
  13964.  
  13965.  
  13966.  
  13967.  
  13968.  
  13969.  
  13970.  
  13971.  
  13972.  
  13973.  
  13974.  
  13975.  
  13976.  
  13977.  
  13978.  
  13979.  
  13980.  
  13981.  
  13982.  
  13983.  
  13984.  
  13985.  
  13986.  
  13987.  
  13988.  
  13989.  
  13990.  
  13991.  
  13992.  
  13993.  
  13994.  
  13995.  
  13996.  
  13997.  
  13998.                                                                          86
  13999.  
  14000.  
  14001.  
  14002.  
  14003.  
  14004.           MOUSECURSORDEFAULT
  14005.  
  14006.             PROTOTYPE
  14007.  
  14008.             SUB MOUSECURSORDEFAULT ()
  14009.  
  14010.             INPUT
  14011.  
  14012.             no input parameters
  14013.  
  14014.             OUTPUT
  14015.  
  14016.             no value returned
  14017.  
  14018.             USAGE
  14019.  
  14020.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  14021.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  14022. ⁿ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  14023. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  14024. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  14025. $╤
  14026. #@Ñú4,p&e÷ü¼_ÇQºÑ4òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±░┤ÖÇD└D0Å╡`   $ «îO@╧1
  14027. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  14028. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩░£▒Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  14029.       end;
  14030.     end;
  14031.   end;
  14032.   WaitToGo;
  14033. end; { UserLineStylePlay }
  14034.  
  14035.  
  14036. procedure SayGoodbye;
  14037. { Say goodbye and then exit the program }
  14038. var
  14039.   ViewInfo : ViewPortType;
  14040. begin
  14041.   MainWindow('');
  14042.   GetViewSettings(ViewInfo);
  14043.   SetTextStyle(TriplexFont, HorizDir, 4);
  14044.   SetTextJustify(CenterText, CenterText);
  14045.   with ViewInfo do
  14046.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  14047.   StatusLine('Press any key to quit...');
  14048.   repeat until KeyPressed;
  14049. end; { SayGoodbye }
  14050.  
  14051.  
  14052. PROCEDURE SelectMode;
  14053. VAR
  14054.     choice1,choice2     : CHAR;
  14055.    xsize,ysize            : WORD;
  14056. BEGIN
  14057.     (* Let's select a mode *)
  14058.     ClrScr;
  14059.     WriteLn('VESADEMO:');
  14060.     WriteLn('1. 256 colors');
  14061.     WriteLn('2. 32768 colors');
  14062.     WriteLn('3. 65536 colors');
  14063.     WriteLn('4. 16777216 colors');
  14064.     WriteLn('Q uit');
  14065.     WriteLn;
  14066.     Write('Your choice: ');
  14067.     REPEAT
  14068.         ReadLn(choice1);
  14069.       IF choice1 <> '1' THEN BEGIN
  14070.           WriteLn('Sorry !');
  14071.          WriteLn('This demo wasn''t written for more as 256 colors !');
  14072.          WriteLn('You would only get a limited impression of the Hi-& TrueColor modes...');
  14073.          WriteLn('Switching to 256 colors.');
  14074.          choice1 := '1';
  14075.       END;
  14076.     UNTIL choice1 IN ['1'..'4','q'];
  14077.     IF choice1 = 'q' THEN Halt;
  14078.  
  14079.     WriteLn;
  14080.     WriteLn;
  14081.     WriteLn('a. 320x200');
  14082.     WriteLn('b. 640x480');
  14083.     WriteLn('c. 800x600');
  14084.     WriteLn('d. 1024x768');
  14085.     WriteLn('e. 1280x1024');
  14086.     WriteLn('Q uit');
  14087.     WriteLn;
  14088.     Write('Your choice: ');
  14089.     REPEAT
  14090.         ReadLn(choice2);
  14091.     UNTIL choice2 IN ['a'..'e','q'];
  14092.     IF choice2 = 'q' THEN Halt;
  14093.  
  14094.     CASE choice2 OF
  14095.         'a' : BEGIN
  14096.             xsize := 320;
  14097.             ysize := 200;
  14098.         END;
  14099.         'b' : BEGIN
  14100.             xsize := 640;
  14101.             ysize := 480;
  14102.         END;
  14103.         'c' : BEGIN
  14104.             xsize := 800;
  14105.             ysize := 600;
  14106.         END;
  14107.         'd' : BEGIN
  14108.             xsize := 1024;
  14109.             ysize := 768;
  14110.         END;
  14111.         'e' : BEGIN
  14112.             xsize := 1280;
  14113.             ysize := 1024;
  14114.         END;
  14115.     END;
  14116.     CASE choice1 OF
  14117.         '1' : mode := FindVesaMode(xsize,ysize,8);
  14118.         '2' : mode := FindVesaMode(xsize,ysize,15);
  14119.         '3' : mode := FindVesaMode(xsize,ysize,16);
  14120.         '4' : mode := FindVesaMode(xsize,ysize,24);
  14121.     END;
  14122.     IF mode = 0 THEN BEGIN
  14123.         WriteLn('No such mode could be found !');
  14124.         WriteLn('Switching to to 320x200.');
  14125.         ReadKey;
  14126.         mode := V320x200x256;
  14127.     END;
  14128. END;
  14129.  
  14130. begin { program body }
  14131.   SelectMode;
  14132.   Initialize;
  14133.   ReportStatus;
  14134.  
  14135. {  AspectRatioPlay; }
  14136.   FillEllipsePlay;
  14137.   SectorPlay;
  14138.   WriteModePlay;
  14139.  
  14140.   ColorPlay;
  14141.   { PalettePlay only intended to work on these drivers: }
  14142.   if (GraphDriver = EGA) or
  14143.       (GraphDriver = EGA64) or
  14144.       (GraphDriver = VGA) then
  14145.      PalettePlay;
  14146.   PutPixelPlay;
  14147. {  PutImagePlay; }
  14148.   RandBarPlay;
  14149.   Bar